|
-
October 29th, 1999, 08:31 AM
#1
Creating controls dynamicaly
How to create controls dynamicaly, and latter to use them trough array.
Please email answer to [email protected]
Thanks
-
October 29th, 1999, 07:18 PM
#2
Re: Creating controls dynamicaly
Hi,
Have the desired control with index 0. To load controls dynamically call "LOAD" control function with a new index. For example,
lets say we have a Textbox control txtCntrl indexed 0 at design time.
At run time u say
..........
........
Load txtCntrl(1)
.......
...........
in the similar way u unload the controls.
Does that answer u'r question
-
October 31st, 1999, 07:36 PM
#3
Re: Creating controls dynamicaly
VB 6 also allows to add controls dynamically at run time without need to have an array. The example of adding Text Box:
private Sub Form_Load()
Form1.Controls.Add "VB.TextBox", "txtMyText"
With Form1!txtMyText ' you can also use next sintax
'With Form1.Controls("txtMyText")
.Visible = true
.Top = 500
.Left = 1000
.Width = 2000
.Height = 315
.Text = "It Works!"
End With
End Sub
Just paste this code into empty form and run.
HTH
Vlad
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
|