找回密码
 加入
搜索
楼主: woeiwoei

[GUI管理] 做个输入器~[已解决]

 火... [复制链接]
发表于 2011-10-26 01:23:44 | 显示全部楼层
把A版的代码换了个颜色
Local $text = '+-×÷﹢﹣±/=≈≡≠∧∨∑∏∪∩∈⊙⌒⊥∥∠' & _
                '∽≌<>≦≧≮≯∧∨√ ﹙﹚[]﹛﹜∫∮∝∞⊙∏'
GUICreate('字符格子例子 By Afan', 400, 200)
GUISetBkColor(0xFFFFFF)
GUISetFont(11)

GUICtrlCreateLabel('', 90, 10, 302, 90)
;~ GUICtrlSetBkColor(-1, 0xCBCED5)
GUICtrlSetBkColor(-1, 000000)
GUICtrlSetState(-1, 128)

Local $aTxt = StringRegExp($text, '.', 3)
Local $_c = UBound($aTxt), $Label[$_c]
For $x = 1 To $_c
        $Label[$x - 1] = GUICtrlCreateLabel($aTxt[$x - 1], 92 + 25 * ($x - (Int(($x - 1) / 12) * 12 + 1)), _
                        12 + 22 * Int(($x - 1) / 12), 23, 20, 0x201)
Next

Local $LD = GUICtrlCreateLabel('', 160, 100, 80, 80, 0x201)
GUICtrlSetFont(-1, 50)
GUICtrlSetColor(-1, 0xCBCED5)

GUISetState()
While 1
        $msg = GUIGetMsg()
        Switch $msg
                Case -3
                        Exit
                Case $Label[0] To $Label[$_c - 1]
                        GUICtrlSetData($LD, $aTxt[$msg - 4])
                        GUICtrlSetColor($LD, 000000)
                                                
        EndSwitch
WEnd
发表于 2011-10-26 01:25:38 | 显示全部楼层
不错不错啊,呵呵
发表于 2011-10-26 09:41:54 | 显示全部楼层
A版的回复 格子线的形成 以后备用
发表于 2011-10-26 22:23:30 | 显示全部楼层
哇。很强大的效果。。学习了。
发表于 2011-10-27 11:56:17 | 显示全部楼层
好东西,支持
发表于 2011-10-27 14:41:33 | 显示全部楼层
写的很好,受教!
发表于 2011-10-27 21:31:25 | 显示全部楼层
我也来学习一下,多谢分享
发表于 2011-10-28 10:34:42 | 显示全部楼层
先收藏,thx
发表于 2011-10-28 11:07:53 | 显示全部楼层
a版太强大的 必须支持
发表于 2011-10-28 12:13:42 | 显示全部楼层
回复 4# afan

非常经典的例子!前辈真是无所不能啊!

让我想到了这个例子。

Global $aButton[25] ;按钮总数
Global $iNumber = 5 ;每行按钮数量
Global $iSpacingX = 50, $iSpacingY = 50 ;垂直、水平,间距

Opt('GUIOnEventMode', 1)

GUICreate('', 300, 300)
GUISetOnEvent(-3, '_ButtonEvents')
For $i = 0 To UBound($aButton) - 1
        $aButton[$i] = GUICtrlCreateButton($i + 1, $iSpacingX * Mod($i, $iNumber) + 25, $iSpacingY * Floor($i / $iNumber) + 25, 50, 50)
        GUICtrlSetOnEvent(-1, '_ButtonEvents')
Next
GUISetState()

While 1
        Sleep(500)
WEnd

Func _ButtonEvents()
        Switch @GUI_CtrlId
                Case -3
                        Exit
                Case $aButton[0] To $aButton[UBound($aButton) - 1]
                        MsgBox(0, '', '按钮 : ' & @GUI_CtrlId - 2)
        EndSwitch
EndFunc   ;==>_ButtonEvents
发表于 2011-11-1 13:36:21 | 显示全部楼层
學習了   都很不錯的
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-17 04:20 , Processed in 0.065648 second(s), 14 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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