找回密码
 加入
搜索
查看: 3505|回复: 4

[GUI管理] [已解決]挑選 4 5 6裡的最大值寫入 15 16 17(求助該如何改ㄚ?)

  [复制链接]
发表于 2010-10-1 21:05:14 | 显示全部楼层 |阅读模式
本帖最后由 tcpuuu 于 2010-10-3 22:12 编辑
GUICreate('COM', 138, 200, 880, 2)

$L1 = GUICtrlCreateInput('', 1, 20, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L2 = GUICtrlCreateInput('', 34, 20, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L3 = GUICtrlCreateInput('', 67, 20, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L4 = GUICtrlCreateInput('', 1, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L5 = GUICtrlCreateInput('', 34, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L6 = GUICtrlCreateInput('', 67, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)


$L7 = GUICtrlCreateInput('', 1, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L8 = GUICtrlCreateInput('', 34, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L9 = GUICtrlCreateInput('', 67, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L10 = GUICtrlCreateInput('', 1, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L11 = GUICtrlCreateInput('', 34, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L12 = GUICtrlCreateInput('', 67, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L13 = GUICtrlCreateInput('', 1, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L14 = GUICtrlCreateInput('', 34, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)




$L15 = GUICtrlCreateInput('', 1, 72, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L16 = GUICtrlCreateInput('', 34, 72, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L17 = GUICtrlCreateInput('', 67, 72, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)



$Button1 = GUICtrlCreateButton('挑選最大值', 2, 150, 120, 25)

GUISetState()

While 1
        $msg = GUIGetMsg()
        Switch $msg
                Case -3
                        Exit
                Case $Button1
                        _Max()

        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
----------------------------------------------------------------------
挑選 4  5  6裡的最大值  寫入 15 16 17

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-10-1 23:49:48 | 显示全部楼层
没明白什么意思,另外把代码里的空行整理下,留那么多行存银子呀?
发表于 2010-10-2 00:13:07 | 显示全部楼层
 楼主| 发表于 2010-10-2 02:32:42 | 显示全部楼层
http://www.autoitx.com/redirect. ... amp;fromuid=7644923
------------------------------------------------------------------------------
我已改過  但是有錯誤
有錯誤!
发表于 2010-10-2 09:43:09 | 显示全部楼层
GUICreate('COM', 500, 500, 180, 500)

$L1 = GUICtrlCreateInput('', 1, 20, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L2 = GUICtrlCreateInput('', 34, 20, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L3 = GUICtrlCreateInput('', 67, 20, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L4 = GUICtrlCreateInput('', 1, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L5 = GUICtrlCreateInput('', 34, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L6 = GUICtrlCreateInput('', 67, 46, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L7 = GUICtrlCreateInput('', 1, 66, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L8 = GUICtrlCreateInput('', 34,66, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L9 = GUICtrlCreateInput('', 67, 66, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L10 = GUICtrlCreateInput('', 1, 86, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L11 = GUICtrlCreateInput('', 34, 86, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L12 = GUICtrlCreateInput('', 67, 86, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L13 = GUICtrlCreateInput('', 1, 106, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L14 = GUICtrlCreateInput('', 34, 106, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L15 = GUICtrlCreateInput('', 67 ,106, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFff)
GUICtrlSetFont(-1, 12)
$L16 = GUICtrlCreateInput('', 1, 126, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$L17 = GUICtrlCreateInput('', 34, 126, 32, 22, 0x008000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 12)
$Button1 = GUICtrlCreateButton('挑選最大值', 2, 150, 120, 25)
GUISetState()
While 1
        $msg = GUIGetMsg()
        Switch $msg
                Case -3
                        Exit
                Case $Button1
                        _Max()
        EndSwitch
WEnd
Func _Max()
        Local $v1 = Number(GUICtrlRead($L4))
        Local $v2 = Number(GUICtrlRead($L5))
        Local $v3 = Number(GUICtrlRead($L6))
        Local $max = $v1, $x = 4, $i
        For $i = 1 To 3
                If Eval("v" & $i) >= $max Then
                        $max = Eval("v" & $i)
                        $x = $i
                EndIf
        Next
        For $i = 15 To 17
                GUICtrlSetData(Eval("L" & $i), '')
                        Next
                        $aa=$x+14
        GUICtrlSetData(Eval("L" & $aa), $max)
EndFunc   ;==>_max
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-23 13:07 , Processed in 0.127471 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表