#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
Opt('MustDeclareVars', 1)
#Region ### START GUI section ###
Local $Mac, $btn, $msg, $Sn, $top_pic, $back_pic, $NB1, $NB2, $pctest, $MACR, $snr
;$font = "MS Sans Serif"
$pctest = GUICreate("条码捆邦系统", 400, 200)
GUICtrlSetState(-1, $Gui_Disable)
GUISetFont(16, 400, 1)
GUICtrlCreateLabel("扫 描 MAC 号:",45,55,150,20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0x0b1746)
$Mac = GUICtrlCreateInput("", 200, 53, 150, 25)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUISetFont(16, 400, 1)
GUICtrlCreateLabel("扫 描 S N 号:",45,100,150,20)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0x0b1746)
$Sn = GUICtrlCreateInput("", 200, 98, 150, 25)
$btn = GUICtrlCreateButton("Ok", 40, 150, 60, 20, $BS_DEFPUSHBUTTON)
GUISetState()
#EndRegion ### end GUI section ###
;-------------------------------------------------------------------------------------------------------------------------
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $btn
$NB1 = GUICtrlRead($Mac)
$NB2 = GUICtrlRead($Sn)
Select
Case $NB1 = ""
GUICtrlSetState($Mac, $GUI_FOCUS)
Case $NB2 = ""
GUICtrlSetState($Sn, $GUI_FOCUS)
Case Else
$MACR = "MAC: " & $NB1
$SNR = " SN: " & $NB2
FileWriteLine('123.xls', $MACR & $SNR)
GUICtrlSetData($Mac, "")
GUICtrlSetData($Sn, "")
GUICtrlSetState($Mac, $GUI_FOCUS)
EndSelect
EndSwitch
WEnd
;------------------------------------------------------------------------------------------------------------ |