VB中的对话框内容输入后点击消失再点击内容恢复的代码怎么写
答案:2 悬赏:40 手机版
解决时间 2021-04-07 23:34
- 提问者网友:雪舞兮
- 2021-04-07 07:00
VB中的对话框内容输入后点击消失再点击内容恢复的代码怎么写
最佳答案
- 五星知识达人网友:猎心人
- 2021-04-07 07:49
Dim a As String
Private Sub Command1_Click()
If Text1.Text <> "" Then
a = Text1.Text
Text1.Text = ""
Exit Sub
Else
Text1.Text = a
End If
End Sub
Private Sub Command1_Click()
If Text1.Text <> "" Then
a = Text1.Text
Text1.Text = ""
Exit Sub
Else
Text1.Text = a
End If
End Sub
全部回答
- 1楼网友:洒脱疯子
- 2021-04-07 09:00
全部代码如下
Private Sub Command1_Click()
Static temp As String
If Text1.Text <> "" Then
temp = Text1.Text
Text1.Text = ""
Else
Text1.Text = temp
End If
End Sub
Private Sub Command1_Click()
Static temp As String
If Text1.Text <> "" Then
temp = Text1.Text
Text1.Text = ""
Else
Text1.Text = temp
End If
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯