找回密码
 加入
搜索
查看: 3715|回复: 7

[已解决]怎样修改IP地址输入框在分页标签中每个分页中都显示?

[复制链接]
发表于 2009-5-5 15:50:40 | 显示全部楼层 |阅读模式
本帖最后由 jycel 于 2009-5-5 17:20 编辑

在分页标签中使用了IP地址输入框,结果在每个分页中都显示出来了?请问怎么修改本分页中显示
解决方法

$Tab1 = GUICtrlCreateTab(8, 112, 500, 329)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("程序说明")
$Pic1 = GUICtrlCreatePic("logo.jpg", 16, 144, 481, 289, 0)
$TabSheet2 = GUICtrlCreateTabItem("即时信息")
$Checkbox2 = GUICtrlCreateCheckbox("开启即时消息", 16, 144, 121, 17)
$Edit2 = GUICtrlCreateEdit("", 16, 172, 481, 161, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUICtrlSetData(-1, "Edit1")
$Group3 = GUICtrlCreateGroup("发送范围", 11, 339, 481, 97)
$Radio3 = GUICtrlCreateRadio("单客户机", 27, 363, 81, 17)
$Radio4 = GUICtrlCreateRadio("群发客户", 27, 403, 89, 25)
$Label2 = GUICtrlCreateLabel("-", 259, 411, 7, 17)
$IPAddress4 = _GUICtrlIpAddress_Create($Form1, 131, 363, 121, 22, -1, $WS_EX_STATICEDGE)
_GUICtrlIpAddress_Set($IPAddress4, "192.168.0.1")
$IPAddress5 = _GUICtrlIpAddress_Create($Form1, 131, 403, 121, 22, -1, $WS_EX_STATICEDGE)
_GUICtrlIpAddress_Set($IPAddress5, "192.168.0.1")
$IPAddress6 = _GUICtrlIpAddress_Create($Form1, 275, 403, 121, 22, -1, $WS_EX_STATICEDGE)
_GUICtrlIpAddress_Set($IPAddress6, "192.168.0.255")
$Button17 = GUICtrlCreateButton("发送消息", 411, 371, 73, 57, $WS_GROUP, $WS_EX_STATICEDGE)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$TabSheet3 = GUICtrlCreateTabItem("分页3")
$TabSheet4 = GUICtrlCreateTabItem("分页4")
$TabSheet5 = GUICtrlCreateTabItem("分页5")
$TabSheet6 = GUICtrlCreateTabItem("分页6")
$TabSheet7 = GUICtrlCreateTabItem("分页7")
$TabSheet8 = GUICtrlCreateTabItem("分页8")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
$n1=GUICtrlRead($Tab1)
if $n1=0 Then
        _GUICtrlIpAddress_ShowHide ($IPAddress4, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress5, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress6, @SW_HIDE)
Elseif $n1=1 Then
        _GUICtrlIpAddress_ShowHide ($IPAddress4, @SW_SHOW)
        _GUICtrlIpAddress_ShowHide ($IPAddress5, @SW_SHOW)
        _GUICtrlIpAddress_ShowHide ($IPAddress6, @SW_SHOW)
ElseIf $n1=2 Then
        _GUICtrlIpAddress_ShowHide ($IPAddress4, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress5, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress6, @SW_HIDE)
ElseIf $n1=3 Then
        _GUICtrlIpAddress_ShowHide ($IPAddress4, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress5, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress6, @SW_HIDE)
        ElseIf $n1=4 Then
        _GUICtrlIpAddress_ShowHide ($IPAddress4, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress5, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress6, @SW_HIDE)
        ElseIf $n1=5 Then
        _GUICtrlIpAddress_ShowHide ($IPAddress4, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress5, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress6, @SW_HIDE)
        ElseIf $n1=6 Then
        _GUICtrlIpAddress_ShowHide ($IPAddress4, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress5, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress6, @SW_HIDE)
        ElseIf $n1=7 Then
        _GUICtrlIpAddress_ShowHide ($IPAddress4, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress5, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress6, @SW_HIDE)
        ElseIf $n1=8 Then
        _GUICtrlIpAddress_ShowHide ($IPAddress4, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress5, @SW_HIDE)
        _GUICtrlIpAddress_ShowHide ($IPAddress6, @SW_HIDE)
        EndIf
        
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

本帖子中包含更多资源

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

×
发表于 2009-5-5 16:17:43 | 显示全部楼层
用GuiGetMsg()截取消息,GuiCtrlRead获取当前选中的标签页。
_GuiCtrlIpAddress_ShowHide隐藏...
发表于 2009-5-5 16:17:49 | 显示全部楼层
To create a new control on an existing tabitem use GUISwitch($hWin,$tabitem) to select it and just create your new control.
 楼主| 发表于 2009-5-5 16:37:05 | 显示全部楼层
用GuiGetMsg()截取消息,GuiCtrlRead获取当前选中的标签页。
_GuiCtrlIpAddress_ShowHide隐藏...
pusofalse 发表于 2009-5-5 16:17

谢谢,我试下!
 楼主| 发表于 2009-5-5 17:06:06 | 显示全部楼层
本帖最后由 jycel 于 2009-5-5 17:12 编辑

明白了,刚简单试了下,只不过每分页是向后移了一位,也就是当为1时,其实点击的是第二个标签
现在改成隐藏命令试下

While 1
$nMsg = GUIGetMsg()
$n1=GUICtrlRead($Tab1)
if $n1=1 Then
        MsgBox(0,"","分页1",2)
ElseIf $n1=2 Then
        MsgBox(0,"","分页2",2)
ElseIf $n1=3 Then
        MsgBox(0,"","分页3",2)
ElseIf $n1=4 Then
        MsgBox(0,"","分页4",2)
ElseIf $n1=5 Then
        MsgBox(0,"","分页5",2)
ElseIf $n1=6 Then
        MsgBox(0,"","分页6",2)
ElseIf $n1=7 Then
        MsgBox(0,"","分页7",2)
ElseIf $n1=8 Then
        MsgBox(0,"","分页8",2)
        EndIf
发表于 2009-5-18 10:32:00 | 显示全部楼层
呵呵,有意思!
发表于 2011-10-10 12:27:05 | 显示全部楼层
谢谢 学习了~
发表于 2013-8-5 23:06:50 | 显示全部楼层
回复 1# jycel

多谢了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-17 14:19 , Processed in 0.105177 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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