对岸的朋友可能描述问题的方式和这边不太一样,理解起来挺费脑细胞…WinKill("COM")
GUICreate("COM", 138, 100, 880, 2)
$L1 = GUICtrlCreateInput("總次數 ", 1, 10, 50, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L2 = GUICtrlCreateInput("命中次數", 54, 10, 40, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L3 = GUICtrlCreateInput("", 72, 46, 50, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$1Button = GUICtrlCreateButton("命中率%", 1, 42, 70, 30)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
Case $1Button
$v1 = Number(GUICtrlRead($L1))
$v2 = Number(GUICtrlRead($L2))
GUICtrlSetData($L3, $v2 / $v1 * 100 & ' %')
EndSwitch
WEnd
Func _Max()
Local $v1 = Number(GUICtrlRead($L4))
Local $v2 = Number(GUICtrlRead($L5))
Local $v3 = Number(GUICtrlRead($L6))
Local $max = $v1, $x = 1, $i
For $i = 5 To 6
If Eval('v' & $i) >= $max Then
$max = Eval('v' & $i)
$x = $i
EndIf
Next
For $i = 15 To 17
GUICtrlSetData(Eval('L' & $i), '')
Next
GUICtrlSetData(Eval('L' & $x + 11), 1)
EndFunc ;==>_max
|