16,554
社区成员
发帖
与我相关
我的任务
分享
Public Class Form1
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If flag = False Then
If TextBox1.Text <> "0" Then
TextBox2.Enabled = False
TextBox2.Text = "0"
End If
End If
End Sub
Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
If flag = False Then
If TextBox2.Text <> "0" Then
TextBox1.Enabled = False
TextBox1.Text = "0"
End If
End If
End Sub
Dim flag As Boolean = False
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
flag = True
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.Enabled = True
TextBox2.Enabled = True
flag = False
End Sub
End Class
TextBox1.Enabled = True
TextBox2.Enabled = True
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.Enabled = True
TextBox2.Enabled = True
TextBox1.Enabled = True
TextBox2.Enabled = True
TextBox1.Text = "0"
TextBox2.Text = "0"