这个是VB作业题,不会编代码。请详细点
'在窗体上画一个TEXT,两个按钮
Dim sTemp As String
Private Sub Command1_Click()
sTemp = Me.Text1.Text
Me.Text1.Text = ""
End Sub
Private Sub Command2_Click()
Me.Text1.Text = sTemp
End Sub
Dim sTemp As String
Private Sub Command1_Click()
sTemp = Me.Text1.Text
Me.Text1.Text = ""
End Sub
Private Sub Command2_Click()
Me.Text1.Text = sTemp
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答 2011-04-01
直接说吧:
首先把值赋给一个变量。
点击一个按钮时,就令TextBox为空
点击另一个按钮时,就令TextBox值为变量值
首先把值赋给一个变量。
点击一个按钮时,就令TextBox为空
点击另一个按钮时,就令TextBox值为变量值
第2个回答 2011-03-30
Dim str As String
Private Sub Command1_Click()
str = Text1.Text
Text1.Text = ""
End Sub
Private Sub Command2_Click()
Text1.Text = str
End Sub
Private Sub Command1_Click()
str = Text1.Text
Text1.Text = ""
End Sub
Private Sub Command2_Click()
Text1.Text = str
End Sub