Rodger Posted November 14, 2010 Share Posted November 14, 2010 (edited) Hello, I have the following code: #include <GuiEdit.au3> #include <GuiTab.au3> #include <GUIComboBox.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #Include <ScrollBarConstants.au3> Local $GUI_PCM, $msg, $aParts[6] = [165, 635, 795 , 935 ,1050, -1] $Version = "1.0" $Build = "18-06-2010:01" $GUI_PCM = GUICreate("ProcessControl Manager",1235,650,-1,-1,$WS_OVERLAPPEDWINDOW +$WS_CLIPCHILDREN + $WS_CLIPSIBLINGS) GUISetStyle(BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_CAPTION, $WS_SIZEBOX, $WS_POPUP, $WS_SYSMENU)) ; The Menu ; Menustructure "File" $PCMFileMenu = GuiCtrlCreateMenu ("File") $PCMFileMenuItem1 = GuiCtrlCreateMenuitem ("Close",$PCMFileMenu) ; Menustructure "Help" $PCMHelpMenu = GuiCtrlCreateMenu ("Help") $PCMHelpMenuMenuItem1 = GuiCtrlCreateMenuitem ("Info",$PCMHelpMenu) ; Process Scheduler ChildTabs $ProcessSchedulerChildGui = GUICreate("",1205,455,15,75,BitOr($WS_CHILD,$WS_TABSTOP),-1,$GUI_PCM) GUISetBkColor(0x257788); just for dimensing the child $ProcessSchedulerChildTab = GUICtrlCreateTab(0,0,1205,455) $ProcessSchedulerChildTabItemPS1 = GUICtrlCreateTabItem("PS1") $ProcessSchedulerChildTabItemPS2 = GUICtrlCreateTabItem("PS2") GUICtrlCreateTabItem("") ; This Child is initially shown GUISetState() ; Process Monitoring ChildTabs $ProcessMonitoringChildGui = GUICreate("",1205,455,15,75,BitOr($WS_CHILD,$WS_TABSTOP),-1,$GUI_PCM) GUISetBkColor(0x257788); just for dimensing the child $ProcessMonitoringChildTab = GUICtrlCreateTab(0,0,1205,455) $ProcessMonitoringChildTabItemPM1 = GUICtrlCreateTabItem("PM1") $ProcessMonitoringChildTabItemPM2 = GUICtrlCreateTabItem("PM2") GUICtrlCreateTabItem("") ; The StatusBar $hStatus = _GUICtrlStatusBar_Create ($GUI_PCM) _GUICtrlStatusBar_SetParts ($hStatus, $aParts,-1) _GUICtrlStatusBar_SetText ($hStatus,"Versie: " & $Version & " - Build: " & $Build,5) ;GUIRegisterMsg($WM_SIZE, "WM_SIZE") GUISwitch($GUI_PCM) ; ParentTab $ParentTab = GUICtrlCreateTab(10, 50, 1215, 485) $ParentTabItemProcessScheduler = GUICtrlCreateTabItem("Process Scheduler") $ParentTabItemProcessMonitoring = GUICtrlCreateTabItem("Process Monitoring") GUICtrlCreateTabItem("") GUISetState() ; Run the GUI until the dialog is closed $msg = 0 While 1 $msg = GUIGetMsg() Select Case $msg = $PCMFileMenuItem1 GUIDelete($GUI_PCM) Exit Case $msg = $PCMHelpMenuMenuItem1 Case $msg = $ParentTab $TabIndex = GUICtrlRead($ParentTab) Select Case $TabIndex = 0 GUISetState(@SW_HIDE, $ProcessMonitoringChildGui) GUISetState(@SW_SHOW, $ProcessSchedulerChildGui) Case $TabIndex = 1 GUISetState(@SW_HIDE, $ProcessSchedulerChildGui) GUISetState(@SW_SHOW, $ProcessMonitoringChildGui) EndSelect Case $msg = $GUI_EVENT_CLOSE GUIDelete($GUI_PCM) Exit EndSelect WEnd ; Resize the EditBox and status bar when GUI size changes Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam) _GUICtrlStatusBar_Resize ($hStatus) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Everytime I press one of the main Tabs, the menu-item "File" is blinking. How can I stop this blinking? Thanks, Rodger Edited November 14, 2010 by Rodger Link to comment Share on other sites More sharing options...
wakillon Posted November 14, 2010 Share Posted November 14, 2010 Please use autoit tag for post your code !I have found a way without blink :Select Case $TabIndex = 0 GUISetState(@SW_HIDE, $ProcessMonitoringChildGui) Sleep ( 250 ) GUISetState(@SW_SHOW, $ProcessSchedulerChildGui) Case $TabIndex = 1 GUISetState(@SW_HIDE, $ProcessSchedulerChildGui) Sleep ( 250 ) GUISetState(@SW_SHOW, $ProcessMonitoringChildGui) EndSelecta little Sleep ( 250 ) between states changes ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
jaberwacky Posted November 14, 2010 Share Posted November 14, 2010 This seems to work for me: ;~ Case $ParentTab ;~ $TabIndex = GUICtrlRead($ParentTab) ;~ Switch $TabIndex ;~ Case 0 ;~ GUISetState(@SW_SHOW, $ProcessSchedulerChildGui) ;~ Case 1 ;~ GUISetState(@SW_SHOW, $ProcessMonitoringChildGui) ;~ EndSwitch Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
Rodger Posted November 16, 2010 Author Share Posted November 16, 2010 Thanks for the help. I will try both options..... Rodger Link to comment Share on other sites More sharing options...
wakillon Posted November 16, 2010 Share Posted November 16, 2010 Thanks for the help.I will try both options.....RodgerJaberwocky6669 is right, don't use GUISetState(@SW_HIDE and there is no blinking ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts 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