Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using Excel XP.
Does anybody have a simple example of how to get items (short strings) in a ListView control in columns? It has to be added in a loop like this: Add item in column 1 Add item in column 2 Add item in column 3 Add item in column 1 etc. Seems a simple thing, but I can't get it to work. Thanks for any assistance. RBS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Let me be a bit more specific.
This is the relevant code bits to do with the ListView: With ListView1 .HideColumnHeaders = False .HideSelection = False .LabelEdit = lvwManual .Sorted = False .TextBackground = lvwOpaque .FullRowSelect = True .View = lvwReport End With With ListView1 .ListItems.Add i, , hwnd .ListItems(i).ListSubItems.Add , , sClassname .ListItems(i).ListSubItems.Add , , sWindowText End With On testing (msgbox, ListView1.ListItems.Count) all seems to be working fine, but nothing shows in the ListView. I can't even get column header to show, although the grey column shows on the top. I am talking here about the Microsoft ListView Control 6.0 (SP6) in VBA. I am just puzzeled by this and would greatly appreciate any advice. RBS "RB Smissaert" wrote in message ... Using Excel XP. Does anybody have a simple example of how to get items (short strings) in a ListView control in columns? It has to be added in a loop like this: Add item in column 1 Add item in column 2 Add item in column 3 Add item in column 1 etc. Seems a simple thing, but I can't get it to work. Thanks for any assistance. RBS |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Still no luck with this.
I replaced the file mscomctl.ocx with a new one, although I had the latest version (6.1.95.45), but it made no difference. Tried all sorts of different syntaxes like: Dim itmX As ListItem Set itmX = ListView1.ListItems.Add itmX.Text = hwnd itmX.ListSubItems.Add , , sClassname itmX.ListSubItems.Add , , sWindowText Still nothing shows in the ListView. Really mysified by this. RBS "RB Smissaert" wrote in message ... Using Excel XP. Does anybody have a simple example of how to get items (short strings) in a ListView control in columns? It has to be added in a loop like this: Add item in column 1 Add item in column 2 Add item in column 3 Add item in column 1 etc. Seems a simple thing, but I can't get it to work. Thanks for any assistance. RBS |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Done some testing with a ListView in it's simplest form.
Opened a new workbook. Added a form. Added a ListView, called ListView1 Added a code module with the following code: Sub LoadUserForm() Load UserForm1 UserForm1.Show With UserForm1.ListView1 .View = lvwReport .Appearance = ccFlat .Enabled = True .FullRowSelect = False .Gridlines = True .HideSelection = False .LabelEdit = lvwManual End With Dim itmX As ListItem Set itmX = UserForm1.ListView1.ListItems.Add itmX.Text = "item1" itmX.ListSubItems.Add , , "item2" itmX.ListSubItems.Add , , "item3" End Sub Now sometimes this shows item1 and sometimes no items. Item 2 and 3 never show. Clearly something is corrupted here. Think I might have to reinstall Excel. RBS "RB Smissaert" wrote in message ... Using Excel XP. Does anybody have a simple example of how to get items (short strings) in a ListView control in columns? It has to be added in a loop like this: Add item in column 1 Add item in column 2 Add item in column 3 Add item in column 1 etc. Seems a simple thing, but I can't get it to work. Thanks for any assistance. RBS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
line up items in column a with items in columns b, c, etc | Excel Discussion (Misc queries) | |||
Adding items to columns in a listbox | Excel Discussion (Misc queries) | |||
I cannot see some columns and some menu items are grayed out | Excel Discussion (Misc queries) | |||
Sort and Match like Items in 2 Columns | Excel Worksheet Functions | |||
Description of Listview and Treeview Controls | Excel Programming |