自己瞎捉摸,没有控件代码,被窝里猜美女,
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
Global $Label[4], $Input[10], $CLR_WHITE, $CLR_SILVER, $Button88
$ii = 1
Global $GUI = GUICreate("监控输入框内容变化实时响应", 620, 300)
$Button88 = GUICtrlCreateButton("查询", 125, 263, 70, 22, 0)
GUICtrlSetState($Button88, 128)
GUICtrlCreateLabel("Label1-4:", 50, 10, 70, 20)
GUICtrlSetFont(-1, 10, 400, 0, 'Arial')
GUICtrlCreateLabel("$Input1-12:", 50, 90, 70, 20)
GUICtrlSetFont(-1, 10, 400, 0, 'Arial')
Global $Label[8]
Local $a = 1
For $i = 1 To 2
For $j = 0 To 1
$Label[$a] = GUICtrlCreateInput("", 50 + $j * 270, $i * 30, 250, 25);, $SS_CENTER)
;GUICtrlSetFont(-1, 16, 800)
GUICtrlSetFont(-1, 11, 400, 0, 'Arial');"微软雅黑")
GUICtrlSetBkColor(-1, 0xFF9933)
GUICtrlSetLimit(-1, 48)
$a += 1
Next
Next
Global $Input[13]
Local $k = 1
For $i = 1 To 5
For $j = 0 To 1
$Input[$k] = GUICtrlCreateInput("", 50 + $j * 270, 80 + $i * 30, 250, 25);, $SS_CENTER)
;GUICtrlSetFont(-1, 16, 800)
GUICtrlSetFont(-1, 11, 400, 0, 'Arial');"微软雅黑")
GUICtrlSetBkColor(-1, 0xFF9933)
$k += 1
Next
Next
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
While 1
Switch GUIGetMsg()
Case -3
Exit
Case $Button88
MsgBox(0, "实时响应", "$input=" & GUICtrlRead($Label[1]) & @CRLF & "$input8=" & GUICtrlRead($Input[8]) & @CRLF & "$input9=" & GUICtrlRead($Input[9]))
EndSwitch
WEnd
Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
Local $hWndFrom, $iIDFrom, $iCode, $EN_CHANGE
$hWndFrom = $lParam
$iIDFrom = _WinAPI_LoWord($wParam)
$iCode = _WinAPI_HiWord($wParam)
;If $iCode = $EN_CHANGE Then
If BitShift($wParam, 16) = 0x300 Then
For $i = 1 To 4
If $iIDFrom = $Label[$i] Then
Local $t1, $t2, $f, $fx
If GUICtrlRead($Label[$i]) = "" Then
GUICtrlSetBkColor($Label[$i], 0xFF9933)
GUICtrlSetBkColor($Input[8], 0xFF9933)
GUICtrlSetBkColor($Input[9], 0xFF9933)
GUICtrlSetData($Label[$i], "")
GUICtrlSetData($Input[8], "")
GUICtrlSetData($Input[9], "")
GUICtrlSetData($Input[$i], "")
GUICtrlSetBkColor($Input[$i], 0xFF9933)
Else
$Inp = GUICtrlRead($Label[$i])
If BitShift($wParam, 16) = 0x300 Then GUICtrlSetData($Input[8], $Inp)
If BitShift($wParam, 16) = 0x300 Then GUICtrlSetData($Input[9], $Inp)
If BitShift($wParam, 16) = 0x300 Then GUICtrlSetState($Button88, 64)
GUICtrlSetBkColor($Label[$i], 0xfbfcfd)
GUICtrlSetBkColor($Input[8], 0xfbfcfd)
GUICtrlSetBkColor($Input[9], 0xfbfcfd)
GUICtrlSetBkColor($Input[$i],0xfbfcfd)
;EndIf
EndIf
If Mod($i, 2) = 0 Then
$f = $i + 1
$t1 = StringStripWS(GUICtrlRead($Input[$i]), 3)
$t2 = StringStripWS(GUICtrlRead($Input[$f]), 3)
$fx = GUICtrlRead($Label[$i / 2])
Else
$f = $i - 1
$t1 = StringStripWS(GUICtrlRead($Input[$f]), 3)
$t2 = StringStripWS(GUICtrlRead($Input[$i]), 3)
$fx = GUICtrlRead($Label[$f / 2])
EndIf
For $j = 0 To 7
If $j <> $i And $j <> $f Then
If $t1 = "" And $t2 = "" Then
;If BitShift($wParam, 16) = 0x300 Then GUICtrlSetState($Input[$j], $GUI_ENABLE)
If BitShift($wParam, 16) = 0x300 Then GUICtrlSetBkColor($Input[$j], 0xFF9933);$CLR_WHITE)
Else
;If BitShift($wParam, 16) = 0x300 Then GUICtrlSetState($Input[$j], $GUI_DISABLE)
If BitShift($wParam, 16) = 0x300 Then GUICtrlSetBkColor($Input[$j], 0xfbfcfd);$CLR_SILVER)
EndIf
EndIf
Next
If $t1 = "" Or $t2 = "" Then
;_GUICtrlListView_DeleteAllItems($lv)
If $t1 <> "" Or $t2 <> "" Then
If $t1 <> "" Then
If BitShift($wParam, 16) = 0x300 Then GUICtrlSetData($Input[2], "等待xxxx输入完成...")
Else
If BitShift($wParam, 16) = 0x300 Then GUICtrlSetData($Input[3], "等待YYYY输入完成...")
EndIf
Else
GUICtrlSetData($Input[2], "")
EndIf
Else
GUICtrlSetData($Input[2], "")
_GetResult($fx, $t1, $t2)
EndIf
ExitLoop
EndIf
Next
EndIf
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
Func _GetResult($fengxiang, $fengxu, $juli)
;其他代码省略
$f_fm = Abs(Number(GUICtrlRead($Input[8])))
$f_jm = Abs(Number(GUICtrlRead($Input[9])))
;其他代码省略
EndFunc ;==>_GetResult
|