VB Tutorial
Tools
Free Downloads
Free Link Directory

Basics
Data Types
Windows Forms
Buttons
Check Box
Text Box
Combo Box
Radio Buttons
Progress Bar
Color & Font Dialogs
Open & Save Dialogs
Process Control

More Complex Examples
Audio Player
Rotating Rectangle


 

Basic controls with Visual Basic 2008

Windows Forms

On this page I am going to share with you some of the basic controls that we will be using in this tutorial. Even though I call them basic controls it does not mean that they are not valuable. Instead it shows the importance of these controls since the are some of the basic foundations for creating windows forms. The following figure shows what some of these controls look like like and afterwards I will give you a brief description of each control.


Figure 1: Basic Controls

Form1:
If you look at figure1(above) then you will see that all the control are contained in the form called Form1. The name Form1 is also displayed on the top of the form border.
If you click once, anywhere on the form the form properties dialog should display somewhere on the right hand side. It should look something like the following:


Figure 2: Form Properties Dialog

If you scroll down the list of properties you will see one that says Text Form1. You can change the Form1 to anything you want to display on the form border. I advise you to keep the Form1.text the same as the Form1.Name. Yes that is right you can also change the actual referral name to anything suiting your program. Should you scroll up to the top of the properties control you will find (Name) Form1. I advice you to always select the correct name every time you create a new Windows form.
You can also change the form.text in runtime by following this procedure:
When you Double Click on the form the (View Code) window will open which looks something like this:

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
End Class

Alter the code by adding (me.text = "Bla bla bla") between the Sub and End Sub tags. your code should look something like the following.

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = "Bla bla bla"
End Sub
End Class

You will notice that the text on the form border still displays "Form1". Should you now press the Start Debugging button (looks like a play button somewhere on the top of your window) your form will be displayed with the text "Bla bla bla".
If you liked this article then Please Thumb This Up with a short review - Stumble It!
Now lets continue to the next page to see more.

 


Email us at: info@pro2visual.com
 

Get your Website Listed on our Free Link Banner Directory
Advertise your site with your own unique link banner we will also provide text links to your site.

Popular Articles

Moving a borderless form in vb.net

ComboBox1.Items.Add

Link Progress Bar with Timer in vb.net

How to open a folder using the process control

Start Vb.net programming. No get rich quick scam

How to Convert the Date Format

Click here for Industry Leading Development Softwa