Krikov Posted February 2, 2010 Share Posted February 2, 2010 Hello, i am having problem to create _GuiCtrlIpAddress_Create in Tab when i set the First Parameter as the Form its OK is any one know how to fix it Thanks, Krikov [topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic] Link to comment Share on other sites More sharing options...
Zedna Posted February 2, 2010 Share Posted February 2, 2010 Look here: http://www.autoitscript.com/forum/index.php?showtopic=72894&view=findpost&p=531772 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 2, 2010 Moderators Share Posted February 2, 2010 (edited) Krikov, You need to create a child window to hold the GUI IP Address Control: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiIPAddress.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $hGUI, $hGUI_Child Local $tab, $tab0, $tab1 Local $hIPAddress, $aMsg ; Create main GUI $hGUI = GUICreate("My GUI Tab with IP", 500, 500) ; Create a child window that will be incorparated into the main GUI $hGUI_Child = GUICreate("", 180, 70, 15, 35, BitOR($WS_CHILD, $WS_TABSTOP), -1, $hGUI) GUISetBkColor(0xFF0000, $hGUI_Child) $hIPAddress = _GUICtrlIpAddress_Create($hGUI_Child, 10, 10) GUISetState(@SW_HIDE) ; Go back to main GUI GUISwitch($hGUI) ; Create tab structure $tab = GUICtrlCreateTab(10, 10, 200, 100) $tab0 = GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("label0", 30, 80, 50, 20) GUICtrlCreateButton("OK", 20, 50, 50, 20) GUICtrlCreateInput("Default", 80, 50, 70, 20) $tab1 = GUICtrlCreateTabItem("tab1") GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlCreateLabel("label3", 20, 130, 50, 20) GUISetState() ; Run the GUI until the dialog is closed While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[0] Case $GUI_EVENT_CLOSE Exit Case $tab ; Show/Hide the child GUI as required Switch GUICtrlRead($tab) Case 0 GUISetState(@SW_HIDE, $hGUI_Child) Case 1 GUISetState(@SW_SHOW, $hGUI_Child) EndSwitch EndSwitch WEnd EndFunc ;==>Example I hope this helps. M23 Edit: Nice trick there, Zedna. Edited February 2, 2010 by Melba23 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...
martin Posted February 2, 2010 Share Posted February 2, 2010 (edited) Hello, i am having problem to create _GuiCtrlIpAddress_Create in Tab when i set the First Parameter as the Form its OK is any one know how to fix it Thanks, Krikov I think that you need to give the parent for the IP control which is a child window. You could just hide it or show it depending on which tab is selected using WinSetState. expandcollapse popup#include <GUIConstantsEx.au3> #Include <GuiIPAddress.au3> Opt('MustDeclareVars', 1) Example() Func Example() Local $tab, $tab0, $tab0OK, $tab0input Local $tab1, $tab1combo, $tab1OK Local $tab2, $tab3, $tab2OK, $msg, $IP1 Local $Gui $Gui = GUICreate("My GUI Tab") ; will create a dialog box that when displayed is centered GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) $tab = GUICtrlCreateTab(10, 10, 200, 100) $tab0 = GUICtrlCreateTabItem("tab0") GUICtrlCreateLabel("label0", 30, 80, 50, 20) $tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20) $tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20) $tab1 = GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 80, 50, 20) $tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon") ; default Jon $tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20) $tab2 = GUICtrlCreateTabItem("IP") $IP1 = _GUICtrlIpAddress_Create ($Gui, 30, 50, 140, 25) WinSetState($IP1, "", @SW_HIDE) $tab3 = GUICtrlCreateTabItem("tab2") GUICtrlSetState(-1, $GUI_SHOW) ; will be display first GUICtrlCreateLabel("label2", 30, 80, 50, 20) $tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50) GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlCreateLabel("label3", 20, 130, 50, 20) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $tab ConsoleWrite("tab" & @CRLF) If GUICtrlRead($tab) = 2 Then WinSetState($IP1, "", @SW_SHOW) Else WinSetState($IP1, "", @SW_HIDE) EndIf EndSwitch WEnd EndFunc ;==>Example Edit:Ummm, a bit slow! Edited February 2, 2010 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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