|
-
Jun 16th, 2005, 09:52 AM
#1
Thread Starter
Junior Member
create controls within code
Hi everyone... i m new to VB... can anybody tell me how can i create a text box control within code...??
thanks in advance...
regards...
-
Jun 16th, 2005, 09:57 AM
#2
Hyperactive Member
Re: create controls within code
A little like this:
VB Code:
Dim TB As New Textbox
With TB
.Location = New Point(20, 20)
.Size = New Size(50,20)
.Text = "This is a test"
.Visible = True
End With
Me.Controls.Add(TB)
That's pretty much it. You can set all of the same properties in code as you can in the form designer.
Oh, and welcome.
-
Jun 16th, 2005, 09:58 AM
#3
Re: create controls within code
If you examine the code that is generated automatically by the form designer (when you drag and drop a new textbox onto a form) you'll get a good idea of how its done.
-
Jun 17th, 2005, 04:41 AM
#4
Thread Starter
Junior Member
Re: create controls within code
oh ! thats exactly wat i was lookin' for... thanks buddies.... u rock...
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
|