What JohnYingling said works (of course since he is a top expert ;-) ).
If you want to create the textbox at
runtime, you can create it and add it to
a Picture box (called Picturebox1) at
runtime with this code...
Dim WithEvents text1 As TextBox
Private Sub Command1_Click() ' the third parameter here sets Picturebox1 as container.
Set text1 = Controls.Add("VB.TextBox", "text1",Picturebox1)
text1.Left = 50
text1.Top = 50 'these positions are relative to the picture box
text1.Visible = True
End Sub
If you wanted to do something simpler, maybe you could
put the textbox in the Picture box at design time
and just make it visible when you want to display it.
(depends what you want to do with it I guess)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.