gelmir Posted August 24, 2015 Posted August 24, 2015 Hi, I have simple problem. I try create GUI with tabs and when I use in one tab IpAddressInputBox then this control is visible for all tabs when I switch view. I attached example of my problem. Could you advice me how to fix this issue? Ofc i can use standard input box but I want to stay with IpadressInputBox in tab. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiIPAddress.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\root\desktop\tabs.kxf $Form1_1 = GUICreate("Form1", 623, 204, 192, 114) $Tab1 = GUICtrlCreateTab(80, 40, 457, 137) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlSetState(-1,$GUI_SHOW) $IPAddress1 = _GUICtrlIpAddress_Create($Form1_1, 400, 88, 105, 17) _GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0") $Button1 = GUICtrlCreateButton("Button1", 256, 80, 113, 17) $Label1 = GUICtrlCreateLabel("Label1", 256, 104, 116, 17) $Edit1 = GUICtrlCreateEdit("", 96, 80, 145, 81) GUICtrlSetData(-1, "Edit1") $Input1 = GUICtrlCreateInput("Input1", 256, 128, 105, 21) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
Moderators Melba23 Posted August 24, 2015 Moderators Posted August 24, 2015 gelmir,Welcome to the AutoIt forums.The IpAddressInputBox control appears on all tabs because AutoIt only automatically manages tab visibility for native-created controls - that one is UDF-created and the user has to deal with keeping things visible/hidden. Look at the Tabs tutorial in the Wiki to see how to add code to do it - come back if you run into problemsM23 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
gelmir Posted August 25, 2015 Author Posted August 25, 2015 (edited) Thx for fast answer. I solved my issue, your post was very helpful. EditI have another question related to tabs. When I try call up my function by using _WM_COMMAND my script doesn't work. I don't now why. When I use GUIGetMsg() or onEventMode() code work. Below I attached example code. In my POV _WM_COMMAND don't see my mouse click on tab (I use _WM_COMMAND in larger script and I want to stay with this solution)I am still looking for solution. If anyone can give me some clue this will be very helpfulexpandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiIPAddress.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\users\root\desktop\tabs.kxf $Form1_1 = GUICreate("Form1", 623, 204, 192, 114) $Tab1 = GUICtrlCreateTab(80, 40, 457, 137) $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") $TabSheet2 = GUICtrlCreateTabItem("TabSheet2") GUICtrlSetState(-1,$GUI_SHOW) $IPAddress1 = _GUICtrlIpAddress_Create($Form1_1, 400, 88, 105, 17) _GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0") $Button1 = GUICtrlCreateButton("Button1", 256, 80, 113, 17) $Label1 = GUICtrlCreateLabel("Label1", 256, 104, 116, 17) $Edit1 = GUICtrlCreateEdit("", 96, 80, 145, 81) GUICtrlSetData(-1, "Edit1") $Input1 = GUICtrlCreateInput("Input1", 256, 128, 105, 21) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") $last_tab=0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit ;~ Case $Tab1;**work when uncomment*** ;~ TAB1() EndSwitch WEnd Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam) If BitAND($wParam, 0x0000FFFF) = $Tab1 Then TAB1();****dont work **** If BitAND($wParam, 0x0000FFFF) = $TabSheet1 Then TAB1();****dont work**** If BitAND($wParam, 0x0000FFFF) = $TabSheet2 Then TAB1();****dont work**** EndFunc ;==>_WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Func TAB1() $current_tab=GUICtrlRead($Tab1) If $current_tab<>$last_tab Then Switch $current_tab Case 0 ControlHide($Form1_1,"",$IPAddress1) Case 1 ControlShow($Form1_1,"",$IPAddress1) EndSwitch EndIf $last_tab=$current_tab EndFunc ;==>TAB1() Edited August 25, 2015 by gelmir
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