Search VB 2010

Showing posts with label vb 2010 Create TextBox with events at Project Runtime. Show all posts
Showing posts with label vb 2010 Create TextBox with events at Project Runtime. Show all posts

Monday, May 16, 2011

VB 2010 Create Controls at Run-Time with events

How to Create Controls at Run-Time in 

VB 2010

VB 2010 Create controls at run-time
Visual Basic Online Course

Logic

The example will show you how to create a control (TextBox) at the Application Run-Time. This TextBox will allow only Numbers. We will create a new TextBox control with event  Text Changed when the form is clicked

Project Design

Create new VB 2010 Windows Application Project (MyPro), don't forget to always Save your project

How does it work

You RUN your project and then click on the Form (Form1) and then you will notice that a TextBox control was created with the same properties that we provided in our example in the code below.

TextBox Properties

Location : The cursor location when click on the Form1
Size : 120,300
Parent : Form1 (Me)
TextAlign : HorizontalAlignment.Left
ForeColor : Color.White
Name : MyNewText
Font : Times New Roman, 10, Regular, Point

Code

Thank you for reading ....

Here are some online Visual Basic lessons and courses :

Visual Basic Courses - Share