|
-
Jan 13th, 2007, 04:11 PM
#1
Thread Starter
Addicted Member
[RESOLVED] [2005] array of listbox
how to i create an array of listbox..list(0),list(1),etc.. like in vb 6
-
Jan 13th, 2007, 04:25 PM
#2
Re: [2005] array of listbox
You can't do control arrays in .NET, and you could search this forum on Control Arrays, and get some answers for the alternative....but heck, I have the feeling that there is a much better answer than that. What is it you are trying to do with multiple listboxes?
My usual boring signature: Nothing
 
-
Jan 13th, 2007, 04:26 PM
#3
Re: [2005] array of listbox
VB Code:
Dim arrListBox(2) As ListBox
Now you'll have 3 listbox references, they are not set to an instance of an object, which you will have to do yourself, either by creating new listboxes like this:
VB Code:
For i as Integer = 0 To 2
arrListBox(i) = New ListBox
arrListBox.Location = New Point(0, i*20)
arrListBox.Size = New Size(100, 100)
Me.Controls.Add(arrListBox(i))
Next i
Or by using Listboxes that already exists on your form:
VB Code:
arrListBox(0) = lstHey
arrListBox(1) = lstDonuts
'etc etc
-
Jan 13th, 2007, 04:29 PM
#4
Thread Starter
Addicted Member
Re: [2005] array of listbox
thanks!!! this will surely help
-
Jan 13th, 2007, 04:31 PM
#5
Re: [2005] array of listbox
Still wondering what you are doing with this. Listboxes are slow and awkward enough that I find it hard to believe that there is a situation where they could not be replaced by something more efficient.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|