Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Adding Controls Dynamically in VB.NET
Author:
Ken Mercer
E-mail:
Click to e-mail author
Submitted:
10/31/2003
Version:
VB.NET
Compatibility:
VB.NET
Category:
Controls
Views:
48460
VB.NET code shows how to add a button control to a form dynamically.
Declarations:
'none
Code:
Private Sub CreatButton() Dim btnYes As System.Windows.Forms.Button ' Create control btnYes = New System.Windows.Forms.Button() ' Set button properties btnYes.Name = "ButtonYes" btnYes.Size = New System.Drawing.Size(70, 30) btnYes.Location = New System.Drawing.Point(300, 30) btn.TabIndex = 1 btnYes.Text = "YES" ' add to the parent form's controls collection Me.Controls.Add(btnYes) End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement