Sign in to follow this  
Followers 0
tbaror

_GUICtrlIpAddressGet with 4 TAB in 1 form

4 posts in this topic

#1 ·  Posted (edited)

hello,

i have created a form ($AForm1_1) that consist 4 tabs and i would like to include the _GUICtrlIpAddressGet at the 4th TAB I did mange to present _GUICtrlIpAddressCreate on the 4th tab but it appearing on all other tabs.

$Masterip = _GUICtrlIpAddressCreate ($AForm1_1,128, 136, 153, 28, $WS_THICKFRAME)
GUICtrlSetFont($Masterip, 8, 400, 0, "Arial")

my question is how do i limit _GUICtrlIpAddressCreate to appear only to the 4th tab

Thanks

Edited by tbaror

Share this post


Link to post
Share on other sites

Using the latest Beta:

#include <GuiConstants.au3>
#include <GuiIPAddress.au3>

Opt("MustDeclareVars", 1)

$Debug_IP = False ; Check ClassName being passed to IPAddress functions, set to True and use a handle to another control to see it work

Global $hIPAddress

_Main()

Func _Main()
    Local $hgui, $hChildGui, $hTab, $hTabItem1, $hTabItem2, $hTabItem3, $hTabItem4
    
    $hgui = GUICreate("IP Address Control Create Example", 400, 300)
    $hChildGui = GUICreate("Child GUI", 360, 250, 20, 35, $WS_CHILD, -1, $hgui)
    GUISwitch($hgui)
    $hTab = GUICtrlCreateTab(10,10,380,280)
    $hTabItem1 = GUICtrlCreateTabItem("Tab 1")
    $hTabItem2 = GUICtrlCreateTabItem("Tab 2")
    $hTabItem3 = GUICtrlCreateTabItem("Tab 3")
    $hTabItem4 = GUICtrlCreateTabItem("Tab 4")
    GUICtrlCreateTabItem("")
    $hIPAddress = _GUICtrlIpAddress_Create ($hChildGui, 10, 10)
    GUISetState(@SW_SHOW, $hgui)

    GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

    ; Wait for user to close GUI
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $hTab
                Switch GUICtrlRead($hTab)
                    Case 0
                        GUISetState(@SW_HIDE, $hChildGui)
                    Case 1
                        GUISetState(@SW_HIDE, $hChildGui)
                    Case 2
                        GUISetState(@SW_HIDE, $hChildGui)
                    Case 3
                        GUISetState(@SW_SHOW, $hChildGui)
                EndSwitch
        EndSwitch
    WEnd
EndFunc   ;==>_Main

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR
    Local $tInfo

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
    $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
    $iCode = DllStructGetData($tNMHDR, "Code")
    Switch $hWndFrom
        Case $hIPAddress
            Switch $iCode
                Case $IPN_FIELDCHANGED ; Sent when the user changes a field in the control or moves from one field to another
                    $tInfo = DllStructCreate($tagNMIPADDRESS, $ilParam)
                    _DebugPrint("$IPN_FIELDCHANGED" & @LF & "--> hWndFrom:" & @TAB & DllStructGetData($tInfo, "hWndFrom") & @LF & _
                            "-->IDFrom:" & @TAB & DllStructGetData($tInfo, "IDFrom") & @LF & _
                            "-->Code:" & @TAB & DllStructGetData($tInfo, "Code") & @LF & _
                            "-->Field:" & @TAB & DllStructGetData($tInfo, "Field") & @LF & _
                            "-->Value:" & @TAB & DllStructGetData($tInfo, "Value"))
                    ; The return value is ignored
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
    ConsoleWrite( _
            "!===========================================================" & @LF & _
            "+======================================================" & @LF & _
            "-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
            "+======================================================" & @LF)
EndFunc   ;==>_DebugPrint

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thanks you Grey for the example

but do you have something much simple to demonstrate the idea since i am newbie :) with Autoit

thanks in advanced

Share this post


Link to post
Share on other sites

Thanks you Grey for the example

but do you have something much simple to demonstrate the idea since i am newbie :) with Autoit

thanks in advanced

1st who is Grey?

2nd not going to get much simpler than that, just cut out what you don't need.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0