|
- Sub Calculate(strFirstNum, strOperator, strSecNum)
- Window("nativeclass:=SciCalc").WinButton("Text:=CE").Click
- Window("nativeclass:=SciCalc").WinButton("Text:=" & strFirstNum).Click
- Window("nativeclass:=SciCalc").WinButton("Text:=" & Replace(Replace(strOperator, "+", "\+"), "*", "\*")).Click
- Window("nativeclass:=SciCalc").WinButton("Text:=" & strSecNum).Click
- Window("nativeclass:=SciCalc").WinButton("Text:==").Click
- End Sub
- 这样调用:
- Calculate 9, "+", 9
- Calculate 9, "-", 9
- Calculate 9, "*", 9
- Calculate 9, "/", 9
复制代码 |
|