tab 分页后加入IP控件问题。最新版本。
上图#include <GUIConstantsEx.au3>
#include <GuiIPAddress.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 415, 299, 272, 229)
$Tab1 = GUICtrlCreateTab(8, 8, 393, 273)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$IPAddress5 = _GUICtrlIpAddress_Create($Form1, 40, 48, 130, 21)
_GUICtrlIpAddress_Set($IPAddress5, "0.0.0.0")
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$IPAddress4 = _GUICtrlIpAddress_Create($Form1, 96, 72, 130, 21)
_GUICtrlIpAddress_Set($IPAddress4, "0.0.0.0")
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
$IPAddress3 = _GUICtrlIpAddress_Create($Form1, 160, 96, 130, 21)
_GUICtrlIpAddress_Set($IPAddress3, "0.0.0.0")
$TabSheet4 = GUICtrlCreateTabItem("TabSheet4")
$IPAddress2 = _GUICtrlIpAddress_Create($Form1, 248, 160, 130, 21)
_GUICtrlIpAddress_Set($IPAddress2, "0.0.0.0")
$TabSheet5 = GUICtrlCreateTabItem("TabSheet5")
$IPAddress1 = _GUICtrlIpAddress_Create($Form1, 272, 240, 130, 21)
_GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
本帖最后由 tnt844 于 2010-4-18 21:32 编辑
; _GUICtrlIpAddress_Create是基于FORM建的,而不是于TAB页,所以会这样,希望老大们能改得更适用些吧。#include <GUIConstantsEx.au3>
#include <GuiIPAddress.au3>
#include <TabConstants.au3>
#include <GuiTab.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 415, 299, 272, 229)
$Tab1 = GUICtrlCreateTab(8, 8, 393, 273)
$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$IPAddress5 = _GUICtrlIpAddress_Create($Form1, 40, 48, 130, 21)
_GUICtrlIpAddress_Set($IPAddress5, "0.0.0.0")
$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$IPAddress4 = _GUICtrlIpAddress_Create($Form1, 96, 72, 130, 21)
_GUICtrlIpAddress_Set($IPAddress4, "0.0.0.0")
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")
$IPAddress3 = _GUICtrlIpAddress_Create($Form1, 160, 96, 130, 21)
_GUICtrlIpAddress_Set($IPAddress3, "0.0.0.0")
$TabSheet4 = GUICtrlCreateTabItem("TabSheet4")
$IPAddress2 = _GUICtrlIpAddress_Create($Form1, 248, 160, 130, 21)
_GUICtrlIpAddress_Set($IPAddress2, "0.0.0.0")
$TabSheet5 = GUICtrlCreateTabItem("TabSheet5")
$IPAddress1 = _GUICtrlIpAddress_Create($Form1, 272, 240, 130, 21)
_GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0")
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
iphide()
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func iphide()
If _GUICtrlTab_GetCurSel($Tab1)=0 Then
_GUICtrlIpAddress_ShowHide($IPAddress5, @SW_SHOW)
_GUICtrlIpAddress_ShowHide($IPAddress4, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress3, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress2, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress1, @SW_HIDE)
ElseIf _GUICtrlTab_GetCurSel($Tab1)=1 Then
_GUICtrlIpAddress_ShowHide($IPAddress5, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress4, @SW_SHOW)
_GUICtrlIpAddress_ShowHide($IPAddress3, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress2, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress1, @SW_HIDE)
ElseIf _GUICtrlTab_GetCurSel($Tab1)=2 Then
_GUICtrlIpAddress_ShowHide($IPAddress5, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress4, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress3, @SW_SHOW)
_GUICtrlIpAddress_ShowHide($IPAddress2, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress1, @SW_HIDE)
ElseIf _GUICtrlTab_GetCurSel($Tab1)=3 Then
_GUICtrlIpAddress_ShowHide($IPAddress5, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress4, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress3, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress2, @SW_SHOW)
_GUICtrlIpAddress_ShowHide($IPAddress1, @SW_HIDE)
ElseIf _GUICtrlTab_GetCurSel($Tab1)=4 Then
_GUICtrlIpAddress_ShowHide($IPAddress5, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress4, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress3, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress2, @SW_HIDE)
_GUICtrlIpAddress_ShowHide($IPAddress1, @SW_SHOW)
EndIf
EndFunc 是啊。。。。改进一下吧。 我想暂时可以用子窗口解决 可以使用隐藏的方法解决 恩,我也是这么解决的,用了两年了,还可以吧,只是有些老机器,会感觉卡些 恩,我也是这么解决的,用了两年了,还可以吧,只是有些老机器,会感觉卡些
llztt 发表于 2010-4-25 07:51 http://www.autoitx.com/images/common/back.gif
你不会吧。用了二年了?上几个版本也没有这个情况吧。
页:
[1]