Please Help,
I want to create a TextBox on a Form by creating it with Code.
(Not select it with a mouse and drag and drop it on the Form!)
In that Code I want to set all its properties. How can I do this?
Thanks
Printable View
Please Help,
I want to create a TextBox on a Form by creating it with Code.
(Not select it with a mouse and drag and drop it on the Form!)
In that Code I want to set all its properties. How can I do this?
Thanks
in VB 6
private Sub Command1_Click()
Dim tx as Control
set tx = me.Controls.Add("VB.TextBox", "test")
tx.Visible = true
End Sub
Thanks,
Just what I needed!
Maarten
why dont you have the textbox already on the form, but set the visiblility to false, and set the properties by text1.whatever.
How to make it work in VB5???
Add a textbox on the form, and make it Index 0, and set visible to false.
In code,
Load TextBox1(1)
TextBox1(1).Left = 100
TextBox1(1).Top = 200
TextBox1(1).Visible = true
Crazy D :-)
"One ring rules them all"
I need to make it as by "code" something like addcontrol thingy, so I was wondering if I could add control in vb some similar way, thanks tho for replying
The only other way I can think of is use CreateWindow API but that's a bit of a pain.. Load .... is the closest you can get in VB5.
Crazy D @ Work :-)