smahdi83 Posted July 9, 2007 Share Posted July 9, 2007 Hi, I have a form which contains a tabbed control. I created new tabs. Now what I want to do is basically hide the tabs on the top. So the user can't select the tab he wants to access. Depending on the action of the user, it will move him to the appropriate tab. How can I do this? Thanks in advance, Link to comment Share on other sites More sharing options...
Generator Posted July 9, 2007 Share Posted July 9, 2007 Maybe try GUICtrlSetState and choose $GUI_DISABLE ? Link to comment Share on other sites More sharing options...
GaryFrost Posted July 9, 2007 Share Posted July 9, 2007 Tab Items, you can insert, delete. Not hide or disable AFIK. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Siao Posted July 9, 2007 Share Posted July 9, 2007 (edited) How about not allowing user to switch to another tab? expandcollapse popup#include <GUIConstants.au3> #Include <GuiTab.au3> Const $WM_NOTIFY = 0x4E Opt("GUIOnEventMode", 1) $Gui = GUICreate("Forced Tab Demo", 400, 300) GUISetOnEvent($GUI_EVENT_CLOSE, "GuiClose") $TabControl = GUICtrlCreateTab(5, 5, 390, 250) $TabSheet1 = GUICtrlCreateTabItem("Step #1") $lbl1 = GUICtrlCreateLabel("Label1", 100, 100) $TabSheet2 = GUICtrlCreateTabItem("Step #2") $lbl2 = GUICtrlCreateLabel("Label2", 100, 150) $TabSheet3 = GUICtrlCreateTabItem("Step #3") $lbl3 = GUICtrlCreateLabel("Label3", 100, 200) GUICtrlCreateTabItem("") $btnBack = GUICtrlCreateButton("&Back", 100, 260, 100, 25) GUICtrlSetOnEvent(-1, "btnBackClick") $btnNext = GUICtrlCreateButton("&Next", 200, 260, 100, 25) GUICtrlSetOnEvent(-1, "btnNextClick") Global $activeTab = _GUICtrlTabGetCurSel($TabControl) GUIRegisterMsg($WM_NOTIFY, "On_WM_NOTIFY") GUISetState(@SW_SHOW,$Gui) While 1 Sleep(100) WEnd Func btnBackClick() If $activeTab = 0 Then Return $activeTab -= 1 _GUICtrlTabSetCurFocus($TabControl, $activeTab) EndFunc Func btnNextClick() If $activeTab = (_GUICtrlTabGetItemCount($TabControl) - 1) Then Return $activeTab += 1 _GUICtrlTabSetCurFocus($TabControl, $activeTab) EndFunc Func GuiClose() Exit EndFunc Func On_WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) If $wParam = $TabControl Then Local $stNMHDR = DllStructCreate("hwnd;uint;int code", $lParam) Local $code = DllStructGetData($stNMHDR, "code") $stNMHDR = 0 If $code == $TCN_SELCHANGING And _GUICtrlTabGetCurFocus($TabControl) == $activeTab Then Return True EndIf EndFunc Edited July 9, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
smahdi83 Posted July 9, 2007 Author Share Posted July 9, 2007 thanks so much thats exactly what I needed! 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