-
Apr 15th, 2001, 07:53 AM
#1
Does anyone know a way to overcome the missing control array feature in vb.net?
I know I can create controls at runtime, but I need them declared withevents and share the same event handlers. I could share the same event handlers, but the problem is that the number of controls to be loaded is not known at design time (could be loaded from a database or something).
-
May 2nd, 2001, 07:53 AM
#2
Fanatic Member
THe only way I can think to overcome this is to introduce a counter value and make the counter value part of the control name.
-
May 2nd, 2001, 09:32 AM
#3
The problem is that you can't 'Dim WithEvents' if you don't have a name for the variable, so loading a variable number of controls is only possible if you don't need the events. The only way I can think of is to declare a maximum number of object variables at design time, and load them when you need them. However, this will limit the number of controls you can use, and will make the code look bulky. It is possible to share an event handler, but again, you have to know the names of the variables at design time.
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
|