VB中有没有指向如TEXT的指针,在线等 急急急

来源:百度知道 编辑:UC知道 时间:2024/06/20 18:08:57
比如我有两个TEXT框,有一个按键用来在文本框中显示一个'1',我想让当我的鼠标在TEXT1中时,单击此按键TEXT1显示为“1”,当我的鼠标在TEXT2中时,单击此按键在TEXT2中显示“1”
我试了 这是有关的程序
Private Sub Text2_lostFocus()
zz = 2
End Sub
Private Sub Text1_lostFocus()
m = 1
End Sub
Private Sub Command6_Click()
If m = 1 Then
Text1.Text = Text1.Text + "1"
End If
If zz = 2 Then
Text2.Text = Text2.Text + "1"
End If
End Sub
结果单击按键后文本框没有了反映
时哪里出了问题了么

VB里干吗用指针啊
真是想不通

Dim tid As Long
Private Sub Text2_lostFocus()
tid = 2
End Sub
Private Sub Text1_lostFocus()
tid = 1
End Sub
Private Sub Command1_Click()
Select Case tid
Case 1
Text1.Text = Text1.Text + "1"
Case 2
Text2.Text = Text2.Text + "1"
End Select
End Sub

不是lostFocus() 事件哦,

是这个
Private Sub Text1_GotFocus()
zz = 1
End Sub
Private Sub Text2_GotFocus()
zz = 2
End Sub

非得指针么?引用不可以?
private t as textbox
Private Sub Text1_GotFocus()
set t = text1
End Sub
Private Sub Text1_GotFocus()
set t = text2
End Sub
Private Sub Command6_Click()
t.text="1"
end sub

1.3楼的代码可用~~~~