找回密码
 加入
搜索
查看: 8543|回复: 19

[GUI管理] 如何在窗口删除指定复选框?[已解决]

 火.. [复制链接]
发表于 2012-12-4 00:40:32 | 显示全部楼层 |阅读模式
本帖最后由 blue_dvd 于 2012-12-4 12:08 编辑

用GUICtrlCreateCheckbox()后
如何在窗口删除这个复选框?
解答在3和4楼
发表于 2012-12-4 00:45:01 | 显示全部楼层
获取句柄后用_WinAPI_DestroyWindow试试看
发表于 2012-12-4 00:56:12 | 显示全部楼层
回复 1# blue_dvd

GUICreate("  ", 475, 377, 192, 114)
GUICtrlCreateCheckbox("Checkbox1", 72, 8, 201, 57)
GUICtrlCreateButton("删除复选框", 72, 136, 161, 65)
GUISetState()
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                        Exit
                Case 4
                        GUICtrlDelete(3)
        EndSwitch
WEnd
发表于 2012-12-4 01:07:25 | 显示全部楼层
一般隐藏就行了。GuiCtrlSetState($iCK, 32)
发表于 2012-12-4 01:31:31 | 显示全部楼层
回复  blue_dvd
annybaby 发表于 2012-12-4 00:56


想多了
发表于 2012-12-4 01:34:57 | 显示全部楼层
回复 5# netegg


    蛋兄不用睡啦??战斗到天明??
 楼主| 发表于 2012-12-4 07:47:03 | 显示全部楼层
上面的三位都是热心人,无私帮助别人,要注意休息呀!
 楼主| 发表于 2012-12-4 07:58:11 | 显示全部楼层
afan、annybaby两位都是正解!
GuiCtrlSetState($iCK, 32)
这个32也太牛了吧!在哪找的?
发表于 2012-12-4 08:44:03 | 显示全部楼层
回复 8# blue_dvd


    联想一下你平时是用哪个宏设置控件或窗口的状态,然后最简单的办法:msgbox一下它的值就知道了,其他的类似,发挥一下你的聪明才智
发表于 2012-12-4 11:07:10 | 显示全部楼层
回复 8# blue_dvd

呵呵,和我一样的。曾经我问  A大   128   那里来的?   什么意思?  还有其他的吗》?
在这里:
   
include-once


 


; #INDEX# =======================================================================================================================


; Title .........: GUIConstantsEx


; AutoIt Version : 3.2


; Language ......: English


; Description ...: Constants to be used in GUI applications.


; Author(s) .....: Jpm, Valik


; Dll ...........:


; ===============================================================================================================================


 


; #CONSTANTS# ===================================================================================================================


; Events and messages


Global Const $GUI_EVENT_CLOSE = -3


Global Const $GUI_EVENT_MINIMIZE = -4


Global Const $GUI_EVENT_RESTORE = -5


Global Const $GUI_EVENT_MAXIMIZE = -6


Global Const $GUI_EVENT_PRIMARYDOWN = -7


Global Const $GUI_EVENT_PRIMARYUP = -8


Global Const $GUI_EVENT_SECONDARYDOWN = -9


Global Const $GUI_EVENT_SECONDARYUP = -10


Global Const $GUI_EVENT_MOUSEMOVE = -11


Global Const $GUI_EVENT_RESIZED = -12


Global Const $GUI_EVENT_DROPPED = -13


 


Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG'


 


; State


Global Const $GUI_AVISTOP = 0


Global Const $GUI_AVISTART = 1


Global Const $GUI_AVICLOSE = 2


 


Global Const $GUI_CHECKED = 1


Global Const $GUI_INDETERMINATE = 2


Global Const $GUI_UNCHECKED = 4


 


Global Const $GUI_DROPACCEPTED = 8


Global Const $GUI_NODROPACCEPTED = 4096


Global Const $GUI_ACCEPTFILES = $GUI_DROPACCEPTED       ; to be suppressed


 


Global Const $GUI_SHOW = 16


Global Const $GUI_HIDE = 32


Global Const $GUI_ENABLE = 64


Global Const $GUI_DISABLE = 128


 


Global Const $GUI_FOCUS = 256


Global Const $GUI_NOFOCUS = 8192


Global Const $GUI_DEFBUTTON = 512


 


Global Const $GUI_EXPAND = 1024


Global Const $GUI_ONTOP = 2048


 


 


; Font


Global Const $GUI_FONTITALIC = 2


Global Const $GUI_FONTUNDER = 4


Global Const $GUI_FONTSTRIKE = 8


 


 


; Resizing


Global Const $GUI_DOCKAUTO = 0x0001


Global Const $GUI_DOCKLEFT = 0x0002


Global Const $GUI_DOCKRIGHT = 0x0004


Global Const $GUI_DOCKHCENTER = 0x0008


Global Const $GUI_DOCKTOP = 0x0020


Global Const $GUI_DOCKBOTTOM = 0x0040


Global Const $GUI_DOCKVCENTER = 0x0080


Global Const $GUI_DOCKWIDTH = 0x0100


Global Const $GUI_DOCKHEIGHT = 0x0200


 


Global Const $GUI_DOCKSIZE = 0x0300     ; width+height


Global Const $GUI_DOCKMENUBAR = 0x0220  ; top+height


Global Const $GUI_DOCKSTATEBAR = 0x0240 ; bottom+height


Global Const $GUI_DOCKALL = 0x0322      ; left+top+width+height


Global Const $GUI_DOCKBORDERS = 0x0066  ; left+top+right+bottom


 


; Graphic


Global Const $GUI_GR_CLOSE = 1


Global Const $GUI_GR_LINE = 2


Global Const $GUI_GR_BEZIER = 4


Global Const $GUI_GR_MOVE = 6


Global Const $GUI_GR_COLOR = 8


Global Const $GUI_GR_RECT = 10


Global Const $GUI_GR_ELLIPSE = 12


Global Const $GUI_GR_PIE = 14


Global Const $GUI_GR_DOT = 16


Global Const $GUI_GR_PIXEL = 18


Global Const $GUI_GR_HINT = 20


Global Const $GUI_GR_REFRESH = 22


Global Const $GUI_GR_PENSIZE = 24


Global Const $GUI_GR_NOBKCOLOR = -2


 


; Background color special flags


Global Const $GUI_BKCOLOR_DEFAULT = -1


Global Const $GUI_BKCOLOR_TRANSPARENT = -2


Global Const $GUI_BKCOLOR_LV_ALTERNATE = 0xFE000000


 


; Other


Global Const $GUI_WS_EX_PARENTDRAG = 0x00100000



;
 楼主| 发表于 2012-12-4 11:59:33 | 显示全部楼层
回复 10# 魔导
神奇,多谢了!
 楼主| 发表于 2012-12-4 12:02:31 | 显示全部楼层
回复 9# annybaby
你说得没错,问题在于隐藏的语句都不知道,无法进行运算,还用不msgbox!
 楼主| 发表于 2012-12-4 12:18:55 | 显示全部楼层
回复 9# annybaby
再问一个问题:所有的GUI控件都可以用GUICtrlDelete()方法删掉吗?
发表于 2012-12-4 12:26:59 | 显示全部楼层
回复 11# blue_dvd

!_!

有啥好奇怪的,帮助文档也有说的,要不然为什么要在程序开头那么多include???
看我上面的程序,你用KODA建立的界面自动生成的窗体,关闭里都是
Case $GUI_EVENT_CLOSE

而我上面是Case -3
就是因为include里面有这句
Global Const $GUI_EVENT_CLOSE = -3
我那样写可以省下一些没有用到的常量定义
其它,如窗口样式等也是一些常数来的~~多查看下汉化包里自带的例子,UDF源码等,有不少好东东哦~~
发表于 2012-12-4 12:35:22 | 显示全部楼层
回复 12# blue_dvd


听你说起来,好像你不知道隐藏语句是我的错???

随便一搜索(不管关键字是:隐藏或者是删除,或者是状态)都可以找到如controlhide,guictrlsetstate,guictrldelete等,都可以达到你的目的~~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-18 09:39 , Processed in 0.080767 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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