private sub command21_click() if msgbox("是否需要下降?",vbquestion+vbyesno+vbdefaultbutton2,"提示")=vbyes then '执行语句 end if end sub
Private bContinue As Boolean Private Sub Command1_Click() If bContinue = False Then '如果标志位为False 弹出对话框 If MsgBox("是否需要下降", vbYesNo, "") = vbYes Then '选择是,修改标志位 bContinue = True End If Exit Sub End If
'如果标志位为True,执行操作 bContinue = False '恢复标志位 '下面进行你要的操作。 '………… End Sub
Private Sub Command1_Click() If Command1.Tag = "1" Then Command1.Caption = "点击我" Command1.Tag = "0"
if msgbox("是否需要下降?",vbquestion+vbyesno+vbdefaultbutton2,"提示")=vbyes then
'执行语句
end if
end sub
Private bContinue As Boolean
Private Sub Command1_Click()
If bContinue = False Then '如果标志位为False 弹出对话框
If MsgBox("是否需要下降", vbYesNo, "") = vbYes Then '选择是,修改标志位
bContinue = True
End If
Exit Sub
End If
'如果标志位为True,执行操作
bContinue = False '恢复标志位
'下面进行你要的操作。
'…………
End Sub
If Command1.Tag = "1" Then
Command1.Caption = "点击我"
Command1.Tag = "0"
…… '你的执行代码
Else
Command1.Caption = "是否需要下降"
Command1.Tag = "1"
End If
End SubPrivate Sub Form_Load()
Command1.Caption = "点击我"
End Sub
If MsgBox("是否需要下降?", vbQuestion Or vbYesNo) = vbCancel Then Exit Sub
'下面是你的执行语句
'……
End Sub
结贴了!!!!呵呵
非常感谢四位!