Visual Basic NET ( 3)


(CheckBox) - 2


' :

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

CheckBox1.ThreeState

= False '1

CheckBox1.Checked = True

CheckBox2.ThreeState

= True '2

CheckBox2.CheckState

= CheckState.Indeterminate

End Sub

 

' :

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

If CheckBox1.Checked Then TextBox1.Text = " " _

Else TextBox1.Text = " "

End Sub

 

' :

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Select Case CheckBox2.CheckState

Case CheckState.Checked

TextBox2.Text = " "

Case CheckState.Unchecked

TextBox2.Text = " "

Case CheckState.Indeterminate

TextBox2.Text = " "

End Select

End Sub

Button1 TextBox1 . Button2 TextBox2 .

. ( , 3.11). , , :

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles CheckBox1.CheckedChanged

Debug.WriteLine(" ")

End Sub

 

Private Sub CheckBox2_CheckStateChanged(ByVal sender As Object, ByVal e As System.EventArgs) _

Handles CheckBox2.CheckStateChanged

Debug.WriteLine(" ")

End Sub

1.

. (. 18.1), Output . : , For Each.




- -  - -  - -