|
|
Title | Bind controls' properties to each other in VB .NET |
Description | This example shows how to bind controls' properties to each other in VB .NET. |
Keywords | binding, data binding, VB.NET, DataBinding, properties, property |
Categories | Database, VB.NET, Controls |
|
|
This program contains a CheckBox and a GroupBox that contains some Labels and TextBoxes. When the form loads, the program executes a single statement that adds a DataBinding to bind the GroupBox's Enabled property to the CheckBox's Checked property. When the user changes the value of the Checked property, the DataBinding automatically changes the value of the GroupBox's Enabled property. That means the user can enable and disable the GroupBox by clicking on the CheckBox.
|
|
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
GroupBox1.DataBindings.Add("Enabled", chkEnabled, _
"Checked")
End Sub
|
|
|
|
|
|