|
-
Mar 31st, 2003, 02:51 PM
#1
Thread Starter
Hyperactive Member
Dynamically create controls
hey,
i've made a app. it has a addon part where the user can add buttons here and there and they can open external app's.
how do i set it up so i can create controls on the fly?
-
Mar 31st, 2003, 03:04 PM
#2
Dim blah as New System.Windows.Forms.Button
blah.Left = anumber
blah.Top = anumber
blah.Text = 'Click Me"
blah.Visible = True
Form1.Controls.Add(blah)
-
Mar 31st, 2003, 03:06 PM
#3
Sleep mode
Re: Dynamically create controls
This creates new instance of button object and add it to your form at runtime . Just provide some specific info related to location and size as you need .
VB Code:
Dim Butn As New System.Windows.Forms.Button()
Butn.Size = New System.Drawing.Size(150, 30)
Butn.Name = "Button1"
Butn.Text = "BUTTON1"
Me.Controls.Add(Butn)
-
Mar 31st, 2003, 03:09 PM
#4
Mix and match both mine and Pirates code. I showed positioning of the control, he covered size.
-
Mar 31st, 2003, 06:25 PM
#5
Thread Starter
Hyperactive Member
-
Apr 1st, 2003, 01:26 PM
#6
I wonder how many charact
what about events?
If you make controls dynamically at run time, say it could be between three to thirty textboxes, how do you code to process the unique events?
-
Apr 1st, 2003, 01:34 PM
#7
Sleep mode
In this case you can use Delegates and WithEvents .
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
|