VB如何实现,多个文本框被一个按钮控制,也就是单击一次,获得光标的文本框数值+1? 200
VB如何实现,多个文本框被一个按钮控制,也就是单击一次,获得光标的文本框数值+1我点一下text1,按commond,text1数值+1,再点再加1,点text2,按co...
VB如何实现,多个文本框被一个按钮控制,也就是单击一次,获得光标的文本框数值+1
我点一下text1,按commond,text1数值+1,再点再加1,点text2,按commond,text2数值+1,再点再加1
就像这样的怎么实现 展开
我点一下text1,按commond,text1数值+1,再点再加1,点text2,按commond,text2数值+1,再点再加1
就像这样的怎么实现 展开
3个回答
展开全部
1、文本框清空抄
text1.text=""
text2.text=""
2、单击窗体 文本袭框2得到焦点百
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
TextBox2.focus()
End Sub
3、文本框1变动度,文本框2跟动
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
text2.text=text1.text
End Sub
text1.text=""
text2.text=""
2、单击窗体 文本袭框2得到焦点百
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
TextBox2.focus()
End Sub
3、文本框1变动度,文本框2跟动
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
text2.text=text1.text
End Sub
2020-05-24
展开全部
先在通用那里声明:Dim t_1,t_2,t_3 As Integer
Private Sub Command1_Click()
If t_1 > 0 Then
Text1.Text = Val(Text1.Text) + 1
ElseIf t_2 > 0 Then
Text2.Text = Val(Text2.Text) + 1
ElseIf t_3 > 0 Then
Text3.Text = Val(Text3.Text) + 1
End If
End Sub
Private Sub Form_Load()
t_1 = 0
t_2 = 0
t_3 = 0
End Sub
Private Sub Text1_GotFocus()
t_1 = 1
t_2 = 0
t_3 = 0
End Sub
Private Sub Text2_GotFocus()
t_2 = 1
t_1 = 0
t_3 = 0
End Sub
Private Sub Text3_GotFocus()
t_3 = 1
t_1 = 0
t_2 = 0
End Sub
Private Sub Command1_Click()
If t_1 > 0 Then
Text1.Text = Val(Text1.Text) + 1
ElseIf t_2 > 0 Then
Text2.Text = Val(Text2.Text) + 1
ElseIf t_3 > 0 Then
Text3.Text = Val(Text3.Text) + 1
End If
End Sub
Private Sub Form_Load()
t_1 = 0
t_2 = 0
t_3 = 0
End Sub
Private Sub Text1_GotFocus()
t_1 = 1
t_2 = 0
t_3 = 0
End Sub
Private Sub Text2_GotFocus()
t_2 = 1
t_1 = 0
t_3 = 0
End Sub
Private Sub Text3_GotFocus()
t_3 = 1
t_1 = 0
t_2 = 0
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询