Support Forums

Full Version: [TuT] How to Make The Checkbox Fill in Textbox's [VB]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, this is my first TuT on here, so I'll make it very simple, hopefully help some people Smile
Lets get started.

What you need:
2 TextBox (Can be More)
1 CheckBox

Code for CheckBox1:
(Delete ALL the CheckBox1 Code and add this:
Code:
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
TextBox1.Text = "Text for TextBox1"
TextBox2.Text = "Text for Textbox2"
Else
TextBox1.Text = ""
TextBox2.Text = ""
End If
End Sub

Very simple, and could be used for various types of things.
Hope this helped Smile
I can't think of many things that could be used for? Also its just a basic If, Else statement.
very simple but I dotn no why you would need it. nice share though.