Stanley
Guest
|
Posted:
Fri Jan 14, 2005 10:03 am Post subject:
How to add Listbox Header |
|
|
Hello everyone,
I need to use a multi-column listbox in my VBA user defined form.
As the following codes initialize the ListBox1 to have multi-columns
then add data to the listbox.
++++++++++++++++++++++++++++++++++++++++
Me.ListBox1.Clear
Me.ListBox1.ColumnCount = 3
Me.ListBox1.ColumnHeads = True
Me.ListBox1.ColumnWidths = "100;100;100"
For i = 0 To UBound(Array1)
Me.ListBox1.AddItem Array1(i).No
Me.ListBox1.Column(1, i) = Array1(i).Name
Me.ListBox1.Column(2, i) = Array(i).Address
Next i
++++++++++++++++++++++++++++++++++++++++
The resulting listbox have an empty header at the 1st row.
My 1st problem is how to add a header to the listbox.
2nd, the column width have been fixed, if the content too long
how can I adjust the individual column width interactively.
Thanks in advance.
Stanley.
|
|