#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("工资计算 By Lovexia", 232, 202, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU))
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Label1 = GUICtrlCreateLabel("基本工资:", 16, 32, 64, 17)
$Input1 = GUICtrlCreateInput("", 80, 25, 121, 21)
$Label2 = GUICtrlCreateLabel("1.5倍小时:", 16, 64, 67, 17)
$Label3 = GUICtrlCreateLabel("2.0倍小时:", 16, 96, 67, 17)
$Label4 = GUICtrlCreateLabel("3.0倍小时:", 16, 129, 67, 17)
$Input2 = GUICtrlCreateInput("", 80, 58, 121, 21)
$Input3 = GUICtrlCreateInput("", 80, 90, 121, 21)
$Input4 = GUICtrlCreateInput("", 80, 122, 121, 21)
$Label5 = GUICtrlCreateLabel("总工资=", 16, 168, 46, 17)
$Button1 = GUICtrlCreateButton("清空(&X)", 152, 152, 57, 41)
GUICtrlSetOnEvent(-1, "Button1Click")
$Label6 = GUICtrlCreateLabel("这里显示总工资", 64, 168, 88, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister('Jisuan', 1000)
While 1
Sleep(100)
WEnd
Func Button1Click()
GUICtrlSetData($Input1, '')
GUICtrlSetData($Input2, '')
GUICtrlSetData($Input3, '')
GUICtrlSetData($Input4, '')
EndFunc ;==>Button1Click
Func Form1Close()
Exit
EndFunc ;==>Form1Close
Func Jisuan()
Local $Xs,$X1x5,$X2,$X3,$Zong,$In1,$In2,$In3,$In4
If GUICtrlRead($Input1) <> '' Then $In1 = GUICtrlRead($Input1)
If GUICtrlRead($Input2) <> '' Then $In2 = GUICtrlRead($Input2)
If GUICtrlRead($Input3) <> '' Then $In3 = GUICtrlRead($Input3)
If GUICtrlRead($Input4) <> '' Then $In4 = GUICtrlRead($Input4)
$Xs = $In1 /174
$X1x5 = $In2*Number(1.5)
$X2 = $In3*Number(2)
$X3 = $In4*Number(3)
$Zong = Round($X1x5+$X2+$X3+$In1,2)
GUICtrlSetData($Label6,$Zong)
EndFunc ;==>Jisuan
我的理解 。不知道合不合意 |