|
-
Aug 24th, 2001, 04:35 AM
#1
Thread Starter
Member
How to create controls at run time(dynamically)
Hai all,
Here is my problem.I want to create the label controls and text box ,list box,command button based on the user requirement to generate the form.Anyone can help me in this please.
Thanks in advance
-
Aug 24th, 2001, 04:43 AM
#2
If you have VB6 you can add controls using the Controls collection of the form.
VB Code:
Dim txtBox As TextBox
Set txtBox = Me.Controls.Add("VB.TextBox", "txtUniqueName")
txtBox.Move 10, 10, 2000, 300
txtBox.Visible = True
Best regards
-
Aug 24th, 2001, 04:50 AM
#3
Thread Starter
Member
Hai Joacim Andersson,
Thanks a lot Master.
-
Aug 24th, 2001, 04:56 AM
#4
Frenzied Member
There is another way if you are interested. If you have one control of a kind (ex. text1(textbox)). Set its index to 0. Now in runtime to load another control just use
VB Code:
Load text1(1)
Load text1(2)
text1(1).visible = true
text1(1).left = text1.left + 200 'or just move it so it isn't under the other control
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
|