hi, I have list box and want to come with 32 X 32 images or logo on the list box how can I do that in visual basic!
Printable View
hi, I have list box and want to come with 32 X 32 images or logo on the list box how can I do that in visual basic!
what do you mean? can you explain in more detail?Quote:
Originally Posted by Alidad
what i mean that when i use list box that come with list, for samele that there is list of computer in list box, (disk, mouse, monitor and computer hardware) so i want to add icon or images next to the list of those name, in the list box, how can i do that!
i dont believe the listbox supports images/icons. listview does though and other componentsQuote:
Originally Posted by Alidad
i see, do you know where i can learn more abou the listview with images/ icon!
Alidad
if you search the forum for posts by me, youll find what youre looking for.Quote:
Originally Posted by Alidad
You can add one to your toolbox from the "Project > Components > Controls tab > select MS Winwods Common Controls 6.0 > click OK. Then drag and drop a listview and imagelist controls to your form.
I have tried with listview and imagelist controls, but how can i write code to make works! i tried with
listview1.listitems.add ("general", (imagelist.index = "1"))
is this is correct!
More list this.
VB Code:
Option Explicit Private Sub Form_Load() With ListView1 .AllowColumnReorder = False .FullRowSelect = True .HideSelection = False .LabelEdit = lvwManual .MultiSelect = False .Sorted = False .View = lvwReport .ColumnHeaders.Add , , "Col1", .Width / 4 .ColumnHeaders.Add , , "Col2", .Width / 4 .ColumnHeaders.Add , , "Col3", .Width / 4 .ColumnHeaders.Add , , "Col4", .Width / 4 .Icons = ImageList1 .SmallIcons = ImageList1 .ListItems.Add , , "Item 1", , 1 .ListItems.Add , , "Item 2", , 2 .ListItems.Add , , "Item 3", , 3 .ListItems.Add , , "Item 4", , 4 .ListItems.Add , , "Item 5", , 5 End With End Sub
thanks so much for your help, this code is helped me to undersand, but I forgot to ask, i also added frame1 and frame2 two, if i click one of catagories in listview called "general", it will bring frame1 on the floor and hide frame2, how can i write that code!