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


Checkbox1 change forms text in vb.net

Check Box


We use CheckBoxes to include or exclude certain elements. Create a new project and on the form create a new Checkbox by using the tools toolbar. By default the checkbox will have both the name and text attribute of "CheckBox1". From here on I will assume that you now how to access the the attributes of a control. If you don't then please refer to the earlier pages in this tutorial.
Change the Text from "CheckBox1" to "My form's text is Superform". Double click the checkbox control to go to its event handling code.

Public Class Form1
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal ...

End Sub
End Class

Change the code into the following.

Public Class Form1
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal ...
    If CheckBox1.Checked = True Then
        Me.Text = "SuperForm"
    Else
        Me.Text = "Form1"
    End If
End Sub
End Class

The output will look something like this.


Figure 4: CheckBox

 

If you liked this article then Please Thumb This Up with a short review - Stumble It!
Continue to the next page.

 


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