How to add Listbox Header
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
How to add Listbox Header

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Stanley
Guest





Posted: Fri Jan 14, 2005 10:03 am    Post subject: How to add Listbox Header Reply with quote

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.

Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB