找回密码
 加入
搜索
查看: 2169|回复: 6

GUICtrlCreateGroup创建的组如何去掉那个细框

  [复制链接]
发表于 2009-7-16 09:12:56 | 显示全部楼层 |阅读模式
高人指教,一直搞不定
发表于 2009-7-16 13:47:34 | 显示全部楼层
去掉细框那还是group控件吗?
发表于 2010-7-16 15:58:57 | 显示全部楼层
正求解
发表于 2010-7-16 16:16:03 | 显示全部楼层
同P版看法~
发表于 2010-7-16 18:42:37 | 显示全部楼层
#include <GUIConstantsEx.au3>
Local $button_1, $group_1, $radio_1, $radio_2, $radio_3
Local $radio_4, $radio_5, $radio_6, $msg
GUICreate("GUICtrlCreateGroup传统实例", 400, 280)
$group_1 = GUICtrlCreateGroup("有细框", 30, 90, 165, 160)
$button_1 = GUICtrlCreateButton("局限", 30, 20, 120, 40)
$radio_1 = GUICtrlCreateRadio("Radio &0", 50, 120, 70, 20)
$radio_2 = GUICtrlCreateRadio("Radio &1", 50, 150, 60, 20)
$radio_3 = GUICtrlCreateRadio("Radio &2", 50, 180, 60, 20)
$radio_4 = GUICtrlCreateRadio("Radio &A", 120, 120, 70, 20)
$radio_5 = GUICtrlCreateRadio("Radio &B", 120, 150, 60, 20)
$radio_6 = GUICtrlCreateRadio("Radio &C", 120, 180, 60, 20)
GUICtrlSetState($radio_1, $GUI_CHECKED)
GUICtrlSetState($radio_6, $GUI_CHECKED)
GUICtrlSetState($button_1, $GUI_FOCUS + $GUI_DEFBUTTON)
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $button_1
MsgBox(0, "局限", '1、有框; 2、无法同时选择两个Radio')
EndSelect
WEnd
#include <GUIConstantsEx.au3>
Local $button_1, $group_1, $radio_1, $radio_2, $radio_3
Local $radio_4, $radio_5, $radio_6
Local $radioval1, $radioval2, $msg
GUICreate("GUICtrlCreateGroup去掉细框实例", 400, 280)
$button_1 = GUICtrlCreateButton("特点", 30, 20, 120, 40)
GUIStartGroup()
$radio_1 = GUICtrlCreateRadio("Radio &0", 50, 120, 70, 20)
$radio_2 = GUICtrlCreateRadio("Radio &1", 50, 150, 60, 20)
$radio_3 = GUICtrlCreateRadio("Radio &2", 50, 180, 60, 20)
GUIStartGroup()
$radio_4 = GUICtrlCreateRadio("Radio &A", 120, 120, 70, 20)
$radio_5 = GUICtrlCreateRadio("Radio &B", 120, 150, 60, 20)
$radio_6 = GUICtrlCreateRadio("Radio &C", 120, 180, 60, 20)
GUICtrlSetState($radio_1, $GUI_CHECKED)
GUICtrlSetState($radio_6, $GUI_CHECKED)
GUICtrlSetState($button_1, $GUI_FOCUS + $GUI_DEFBUTTON)
$radioval1 = 0
$radioval2 = 2
GUISetState()
While 1
 $msg = GUIGetMsg()
 Select
  Case $msg = $GUI_EVENT_CLOSE
   Exit
  Case $msg = $button_1
   MsgBox(0, "特点", '1、无框;  2、可同时选择两个Radio:' & @LF & "Radio " & $radioval1 & @LF & "Radio " & Chr($radioval2 + Asc("A")))
  Case $msg = $radio_1 Or $msg = $radio_2 Or $msg = $radio_3
   $radioval1 = $msg - $radio_1
  Case $msg = $radio_4 Or $msg = $radio_5 Or $msg = $radio_6
   $radioval2 = $msg - $radio_4
 EndSelect
WEnd

GUICtrlCreateGroup

在GUI上创建一个分组(Group)控件.
注意/说明
所谓组框是指那些围住其它控件(通常是一些单选框按钮)的细线,使这些控件看起来(实际上也是)被归为一组.在组框内每次只能选中一个单选框.
若不想让组框的那些细线显示出来则可使用 GUIStartGroup() 来组合单选框按钮.
要使用上面的值这个,需要在您的脚本中使用 #include <ButtonConstants.au3>.

GUIStartGroup

使此后所有被创建的控件都归为一组.

注意/说明
本函数一般用于单选按钮控件.当用户点击某个单选按钮时其它所有在同一组的单选按钮将被重设.GUIStartGroup 函数使得我们能够轻松地定义控件组.

本帖子中包含更多资源

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

×
发表于 2010-7-16 19:24:29 | 显示全部楼层
回复 5# lynfr8

其实也可以如此:
$radio_1 = GUICtrlCreateRadio("Radio &0", 50, 120, 70, 20,0x00020000)
$radio_2 = GUICtrlCreateRadio("Radio &1", 50, 150, 60, 20)
$radio_3 = GUICtrlCreateRadio("Radio &2", 50, 180, 60, 20)

$radio_4 = GUICtrlCreateRadio("Radio &A", 120, 120, 70, 20,0x00020000)
$radio_5 = GUICtrlCreateRadio("Radio &B", 120, 150, 60, 20)
$radio_6 = GUICtrlCreateRadio("Radio &C", 120, 180, 60, 20)
GUICtrlSetState($radio_1, $GUI_CHECKED)
GUICtrlSetState($radio_6, $GUI_CHECKED)

评分

参与人数 1贡献 +5 收起 理由
lynfr8 + 5 很棒的见解

查看全部评分

发表于 2010-7-17 12:09:09 | 显示全部楼层
学习了,,这个没边框没什么意思。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 01:12 , Processed in 0.086646 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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