按钮名称叫cmd1,要用DoEvents语句来响应按钮事件。示例:
private sub form_load()
cmd1.caption=“开始"
end sub
private sub ProgRun()
DoEvents
'程序处理
.....
end sub
private sub cmd1_click()
if cmd1.caption='开始' THEN
cmd1.caption="暂停"
ProgRun
ELSE
cmd1.caption="开始"
end if
end sub
Private Sub Command1_Click()
If Command1.Caption = "开始"Then
Label1= "‘正在执行程序"
Command1.Caption = "暂停"
Else
label1= "程序已暂停"
Command1.Caption = "开始"
End If
End Sub