y0_Aero Posted December 9, 2015 Share Posted December 9, 2015 Hello i was wondering if anyone could point out what's wrong with this code.It's on it's own TAB and the IP Address inputbox displays but also shows on every other Tab aswell and i can't see where it references the other tabs?$TabSheet3 = GUICtrlCreateTabItem("IP Tools") GUICtrlSetState(-1,$GUI_SHOW) GUICtrlCreateLabel("Ping an IP Address", 40, 48, 116, 20) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $Button5 = GUICtrlCreateButton("Ping", 48, 104, 97, 25) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $IPAddress1 = _GUICtrlIpAddress_Create($Form1, 24, 72, 145, 25) _GUICtrlIpAddress_Set($IPAddress1, "127.0.0.1")Any help would be appreciated. Link to comment Share on other sites More sharing options...
Kovacic Posted December 9, 2015 Share Posted December 9, 2015 Any chance you could post the complete code so we can run it? Even if you just add whatever includes you are using and strip out the stuff you don't need. This will make it easier for people to help out. C0d3 is P0etry( ͡° ͜ʖ ͡°) Link to comment Share on other sites More sharing options...
y0_Aero Posted December 9, 2015 Author Share Posted December 9, 2015 expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <Inet.au3> #include <GuiIPAddress.au3> Global $YourIP = _GetIp() $Form1 = GUICreate("Toolbox", 423, 309, 485, 177) $PageControl1 = GUICtrlCreateTab(0, 8, 444, 320) $TabSheet1 = GUICtrlCreateTabItem("Home") $Pic2 = GUICtrlCreatePic("\\path", 4, 33, 417, 273) $TabSheet2 = GUICtrlCreateTabItem("Project") $Edit1 = GUICtrlCreateEdit("", 16, 72, 385, 185) GUICtrlSetData(-1, "Edit1") GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Button1 = GUICtrlCreateButton("Run Script", 16, 264, 89, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Button2 = GUICtrlCreateButton("Clear Text", 328, 264, 73, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Label1 = GUICtrlCreateLabel("Enter the workstation names below ", 32, 56, 362, 18) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Button3 = GUICtrlCreateButton("Export Script", 224, 264, 89, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Button4 = GUICtrlCreateButton("Import File", 120, 264, 89, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $TabSheet3 = GUICtrlCreateTabItem("IP Tools") GUICtrlSetState(-1,$GUI_SHOW) GUICtrlCreateLabel("Ping an IP Address", 40, 48, 116, 20) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $Button5 = GUICtrlCreateButton("Ping", 48, 104, 97, 25) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $IPAddress1 = _GUICtrlIpAddress_Create($Form1, 24, 72, 145, 25) _GUICtrlIpAddress_Set($IPAddress1, "127.0.0.1") $TabSheet4 = GUICtrlCreateTabItem("CMD") $TabSheet5 = GUICtrlCreateTabItem("Programs") $TabSheet6 = GUICtrlCreateTabItem("Active Directory") $About = GUICtrlCreateTabItem("About") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW)Hey Kovacic, Above is my whole GUI code including includes, every other tab works fine and doesn't overlap to other tabs it's just that IP input box. Link to comment Share on other sites More sharing options...
Kovacic Posted December 9, 2015 Share Posted December 9, 2015 This fixes your issue, but it doesn't want to seem to keep the value of the control. Most controls work fine with tabs (except tables and custom built controls like this one), so I am just closing it when not in use. If this doesnt work for you, you may want to search for a method to simply move it off the view of the GUI while not in use ( like 1000,1000). expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <Inet.au3> #include <GuiIPAddress.au3> Global $YourIP = _GetIp() $Form1 = GUICreate("Toolbox", 423, 309, 485, 177) $PageControl1 = GUICtrlCreateTab(0, 8, 444, 320) $TabSheet1 = GUICtrlCreateTabItem("Home") $Pic2 = GUICtrlCreatePic("\\path", 4, 33, 417, 273) $TabSheet2 = GUICtrlCreateTabItem("Project") $Edit1 = GUICtrlCreateEdit("", 16, 72, 385, 185) GUICtrlSetData(-1, "Edit1") GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Button1 = GUICtrlCreateButton("Run Script", 16, 264, 89, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Button2 = GUICtrlCreateButton("Clear Text", 328, 264, 73, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Label1 = GUICtrlCreateLabel("Enter the workstation names below ", 32, 56, 362, 18) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Button3 = GUICtrlCreateButton("Export Script", 224, 264, 89, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $Button4 = GUICtrlCreateButton("Import File", 120, 264, 89, 25) GUICtrlSetFont(-1, 8, 400, 0, "Arial") $TabSheet3 = GUICtrlCreateTabItem("IP Tools") GUICtrlSetState(-1,$GUI_SHOW) GUICtrlCreateLabel("Ping an IP Address", 40, 48, 116, 20) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $Button5 = GUICtrlCreateButton("Ping", 48, 104, 97, 25) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $IPAddress1 = _GUICtrlIpAddress_Create($Form1, 24, 72, 145, 25) _GUICtrlIpAddress_Set($IPAddress1, "127.0.0.1") $TabSheet4 = GUICtrlCreateTabItem("CMD") $TabSheet5 = GUICtrlCreateTabItem("Programs") $TabSheet6 = GUICtrlCreateTabItem("Active Directory") $About = GUICtrlCreateTabItem("About") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) Global $LastIP = "127.0.0.1" While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $PageControl1 $LastIP = GuiCtrlRead($IPAddress1) if GUICtrlRead($PageControl1) = 2 then $IPAddress1 = _GUICtrlIpAddress_Create($Form1, 24, 72, 145, 25) GuiCtrlSetData($IPAddress1, $LastIP) else _GUICtrlIpAddress_Destroy ($IPAddress1) endif EndSwitch WEnd C0d3 is P0etry( ͡° ͜ʖ ͡°) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 9, 2015 Moderators Share Posted December 9, 2015 y0_Aero,The IPAddress control is created by a UDF and not by a native AutoIt function, so the tabs will not automatically deal with it. You need to do the hiding/showing yourself - the Tabs tutorial in the Wiki shows you how you do this.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Zedna Posted December 9, 2015 Share Posted December 9, 2015 (edited) Here is exactly the same question answered with nice/simple example: Edited December 9, 2015 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now