private intSum as integerprivate sub cmdStart_Click() { intSum = intSum + 1 if intSum = 1 then msgbox "1" else if intSum = 2 then msgbox "2" else if intSum = 3 then msgbox "3" else if intSum = 4 then do while 1 doevents loop }
这么简单我觉得你自己想想动动手,相信实践出真理不好意思最近老用C竟然写了"{}"private intSum as integer private sub cmdStart_Click() intSum = intSum + 1 if intSum = 1 then msgbox "1 " else if intSum = 2 then msgbox "2 " else if intSum = 3 then msgbox "3 " else if intSum = 4 then do while 1 doevents loop end sub
DIM I AS LONG PRIVATE SUB COMMAND1_CLICK() I=I+1 I=I MOD 3 MSGBOX "I=" & I+1 END SUB
楼上为何要用到循环和DOEVENTS,思路比较特异,没看明白意思
private intSum as integer intsum=0 private sub cmdStart_Click() intSum = intSum + 1 if intSum = 1 then msgbox "1 " elseif intSum = 2 then msgbox "2 " elseif intSum = 3 then msgbox "3 " intsum = 1 end if end sub
粗心了。。private intSum as integer intsum=0 private sub cmdStart_Click() intSum = intSum + 1 if intSum = 1 then msgbox "1 " elseif intSum = 2 then msgbox "2 " elseif intSum = 3 then msgbox "3 " intsum = 0 end if end sub
{
intSum = intSum + 1
if intSum = 1 then
msgbox "1"
else if intSum = 2 then
msgbox "2"
else if intSum = 3 then
msgbox "3"
else if intSum = 4 then
do while 1
doevents
loop
}
if intSum = 1 then
msgbox "1 "
else if intSum = 2 then
msgbox "2 "
else if intSum = 3 then
msgbox "3 "
else if intSum = 4 then
do while 1
doevents
loop
end sub
PRIVATE SUB COMMAND1_CLICK()
I=I+1
I=I MOD 3
MSGBOX "I=" & I+1
END SUB
private intSum as integer intsum=0
private sub cmdStart_Click()
intSum = intSum + 1
if intSum = 1 then
msgbox "1 "
elseif intSum = 2 then
msgbox "2 "
elseif intSum = 3 then
msgbox "3 "
intsum = 1
end if
end sub
private sub cmdStart_Click()
intSum = intSum + 1
if intSum = 1 then
msgbox "1 "
elseif intSum = 2 then
msgbox "2 "
elseif intSum = 3 then
msgbox "3 "
intsum = 0
end if
end sub