Dynamic control creation-HOW??? 
Author Message
 Dynamic control creation-HOW???

I know that, somehow, I can dynamically add controls to a control array
in VB5, but I don't know how.  Please help me.  I think it may require
the load statement, is this right?

Thanks,
Andrew
(please reply by email, I don't visit newsgroups very often, and don't
want the answer to disappear)

--
"If all else fails, read the manual."
http://www.*-*-*.com/ ; Andrew's QBASIC and
Visual Basic page.



Thu, 26 Jul 2001 03:00:00 GMT  
 Dynamic control creation-HOW???
You need to start with at least one element of the control array on your
Form at design time. Set its Index property to 0 (zero). Now you can load
others using the Load statement. When you load another copy then its Left
and Top properties are set to the same as the original and its Visible
property is set to False (so you will not see it unless you change these
settings):

Load Picture1(1)
Picture1(1).Left = Picture1(0).Left + 500
Picture1(1).Top = Picture1(0).Top + 500
Picture1(1).Visible = True

To unload it just use:

Unload Picture1(1)

Mike

Quote:

>I know that, somehow, I can dynamically add controls to a control array
>in VB5, but I don't know how.  Please help me.  I think it may require
>the load statement, is this right?

>Thanks,
>Andrew
>(please reply by email, I don't visit newsgroups very often, and don't
>want the answer to disappear)

>--
>"If all else fails, read the manual."
>http://www.geocities.com/SiliconValley/Peaks/4865/   Andrew's QBASIC and
>Visual BASIC page.



Thu, 26 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dynamic Controls Creation and Referencing the new Control.

2. Dynamic Control Creation, Controls object has no .Add ???

3. Dynamic creation of web controls in VB.NET

4. Dynamic Control Creation - Expand Form?

5. Dynamic Creation of Controls

6. Dynamic control creation

7. Dynamic control creation and calling DOS programs from VB.

8. dynamic creation of controls?

9. VB6-Dynamic Control Creation

10. Dynamic creation of Control Array on a SSTab

11. Dynamic creation of Controls

12. Dynamic control creation?

 

 
Powered by phpBB® Forum Software