gotfocus控件使用函数
有text1至text10共10个文本窗口也有10个gotfocus控件当单击command按钮时只计算获取标点的text文本窗口中的值求具体代码...
有text1至text10 共10个文本窗口 也有10个gotfocus控件 当单击command按钮时 只计算获取标点的text文本窗口中的值 求具体代码
展开
展开全部
那不叫gotfocus控件,叫gotfocus事件
Dim tt As TextBox
Private Sub Command1_Click()
MsgBox tt.Text
End Sub
Private Sub Text1_GotFocus()
Set tt = Text1
End Sub
Private Sub Text2_GotFocus()
Set tt = Text2
End Sub
对类似问题建议使用控件数组,将Text1设置为控件数组,不管有多少Text,只需一个GotFocus事件即可:
Dim tt As TextBox
Private Sub Command1_Click()
MsgBox tt.Text
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Set tt = Text1(Index)
End Sub
Dim tt As TextBox
Private Sub Command1_Click()
MsgBox tt.Text
End Sub
Private Sub Text1_GotFocus()
Set tt = Text1
End Sub
Private Sub Text2_GotFocus()
Set tt = Text2
End Sub
对类似问题建议使用控件数组,将Text1设置为控件数组,不管有多少Text,只需一个GotFocus事件即可:
Dim tt As TextBox
Private Sub Command1_Click()
MsgBox tt.Text
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Set tt = Text1(Index)
End Sub
展开全部
那不叫gotfocus控件,叫gotfocus事件
Dim tt As TextBox
Private Sub Command1_Click()
MsgBox tt.Text
End Sub
Private Sub Text1_GotFocus()
Set tt = Text1
End Sub
Private Sub Text2_GotFocus()
Set tt = Text2
End Sub
对类似问题建议使用控件数组,将Text1设置为控件数组,不管有多少Text,只需一个GotFocus事件即可:
Dim tt As TextBox
Private Sub Command1_Click()
MsgBox tt.Text
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Set tt = Text1(Index)
End Sub
Dim tt As TextBox
Private Sub Command1_Click()
MsgBox tt.Text
End Sub
Private Sub Text1_GotFocus()
Set tt = Text1
End Sub
Private Sub Text2_GotFocus()
Set tt = Text2
End Sub
对类似问题建议使用控件数组,将Text1设置为控件数组,不管有多少Text,只需一个GotFocus事件即可:
Dim tt As TextBox
Private Sub Command1_Click()
MsgBox tt.Text
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Set tt = Text1(Index)
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
将text1至text10改名为txtText(1)至txtText(10)
Dim GotFocusText
Private Sub Command1_Click()
MsgBox txtText(GotFocusText).Text
End Sub
Private Sub txtText_GotFocus(Index As Integer)
GotFocusText = Index
End Sub
Dim GotFocusText
Private Sub Command1_Click()
MsgBox txtText(GotFocusText).Text
End Sub
Private Sub txtText_GotFocus(Index As Integer)
GotFocusText = Index
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询