给个可以输入小数的代码,应该还有强人可以写更好的。#include <MsgBoxConstants.au3>
$GuiInfo = GUICreate("Data",250,150)
$GuiInput= GUICtrlCreateInput("",140,10,80,30)
$guicombolbl = GUICtrlCreateLabel("key Number",10,10,80,30)
GUISetState(@SW_SHOW)
while 2
$gMsg = GUIGetMsg()
Switch $gMsg
Case -3
Exit
Case $GuiInput
$test = GUICtrlRead($GuiInput)
MsgBox(0,"",$test)
$test2 = StringIsInt($test)
$test3 = StringIsFloat($test)
If $test2 = 0 and $test3 = 0 Then
MsgBox($MB_SYSTEMMODAL, "", "变量不是一个数字")
Else
MsgBox($MB_SYSTEMMODAL, "", "变量是一个数字:" & $test)
EndIf
EndSwitch
WEnd
|