|
-
Sep 20th, 2003, 02:25 PM
#1
Thread Starter
Junior Member
controls.add in vb5?
Hello,
I'm relatively new to ActiveX, so you'll have to excuse my ignorance.
I tried to add a dynamically created control to the controls collection of a form, but it seems that this is not possible since there is no Add method in this collection. I am using vb5. Is it because I'm using vb5 or am I missing something?
If it is because I am using vb5, is there some workaround?
-
Sep 21st, 2003, 03:53 PM
#2
It's VB5. This code works for 6 but not for 5 :
VB Code:
Private Sub Form_Load()
Dim TXT As Control
Set TXT = Me.Controls.Add("VB.TextBox", "ControlName", Me)
TXT.Text = "aaa"
TXT.Visible = True
End Sub
I guess a workaround is to have a control array and load the control with the next index and show it...
Last edited by manavo11; Sep 21st, 2003 at 03:57 PM.
Has someone helped you? Then you can Rate their helpful post. 
-
Sep 22nd, 2003, 01:37 PM
#3
Thread Starter
Junior Member
Thank you for your response.
Originally posted by manavo11
I guess a workaround is to have a control array and load the control with the next index and show it...
Yes, but the problem is that I will only know the name of the control at run-time. (I'm trying to make something with plug-ins.)
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
|