ListIconGadget() Troubles

Windows specific forum
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by lee__48.

Help Required:

I can add an item to a ListIconGadget() using AddGadgetColumn(), but how do I remove it?

RemoveGadgetItem() doesn't work, and there is no RemoveGadgetColumn() command!

Cheers,
Lee.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.

if you want to remove a column you can do it like this:

Code: Select all

SendMessage_(GadgetID(#YOUR_GADGET), #LVM_DELETECOLUMN, YourColumn, 0)
; where YourColumn is the column you want to delete.
; columns start at 0 for the first column.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by lee__48.
Originally posted by Pupil

if you want to remove a column you can do it like this:

Code: Select all

SendMessage_(GadgetID(#YOUR_GADGET), #LVM_DELETECOLUMN, YourColumn, 0)
; where YourColumn is the column you want to delete.
; columns start at 0 for the first column.
That works a treat! Thanks a lot for your help. :)
Lee.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fullernator.

While on the subject of the ListIconGadget(), I can only seem to add values to the first column... how do you add stuff to the other columsn you create?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

By using the Chr(10) separator

a$= "first column"+chr(10)+"second one"

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by bpbig.

Help Required:

I can add an item to a ListIconGadget() using AddGadgetColumn(), but how do I resize the column width? and how do I change the label text?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.

Check the API messages:
#LVM_SETCOLUMNWIDTH
#LVM_SETCOLUMN

example to set the column width:

Code: Select all

SendMessage_(GadgetID(#YourGadget), #LVM_SETCOLUMNWIDTH, YourColumn, #LVSCW_AUTOSIZE)
; autosize the column to fit the largest item in list
; if you want to set a specific width exchange the
; constant #LVSCW_AUTOSIZE with the width you want.
Post Reply