Creating array of controls at run time 
Author Message
 Creating array of controls at run time

Hi all !
1)i want to create an array of controls at run time in
eVB. how is it possible. can anyone help me and give some
example. i tried though coding but Load() can't be used in
eVB as in Vb6.0.
actualy wut i want to create and show a button on the form
by clicking on another button.

2)How to use module in eVB. i used it as in vb6 and define
some Global variables but it does't accept those. how to
define Global variables then in eVB.

thanx in advance



Wed, 13 Apr 2005 16:37:51 GMT  
 Creating array of controls at run time

Quote:
> Hi all !
> 1)i want to create an array of controls at run time in
> eVB. how is it possible. can anyone help me and give some
> example. i tried though coding but Load() can't be used in
> eVB as in Vb6.0.
> actualy wut i want to create and show a button on the form
> by clicking on another button.

There is an example on how to "dynamically" create your controls on DevBuzz.
The way to do it is to add a lot of invisible controls to your form (as many
as you will ever need!).
When you want to create the "new" control, you just use one from this pool.

As for control arrays, then they are not supported. The workaround is to
create an array of objects and then set each item in the array to be one of
your controls.
Just remember that you can't use some common event handler for a set of
controls, so you have to do quite some programming to make things happen the
way you want them to.

Quote:

> 2)How to use module in eVB. i used it as in vb6 and define
> some Global variables but it does't accept those. how to
> define Global variables then in eVB.

That's not a problem. Just use the keyword Public instead. That one is
covered in the on-line help.
Any public variable is available throughout the whole program.

Keld Laursen



Wed, 13 Apr 2005 18:36:31 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Creating controls in a control array at run-time

2. create & add controls array in run time

3. Creating Control Arrays At Run Time

4. Creating Controls at Run time using Collections not Arrays

5. Create Control Array and add item at run time

6. Creating control arrays at run time?

7. VB6 - Creating Control Array at Run Time

8. create a control array at run time

9. Adding elements to a control array of Menu items with subMenus at Run time

10. control arrays at run time

11. Run time error 340 - control array element does not exist

12. Run-Time Control Array of Option Buttons w/in Frames

 

 
Powered by phpBB® Forum Software