Shuresh Posted July 3, 2008 Posted July 3, 2008 How to Navgate in different Tab Controls.. please check the attachement for clarification I need to open the next tab automatically... Thanks Shuresh
tlokz Posted July 4, 2008 Posted July 4, 2008 (edited) How to Navgate in different Tab Controls.. please check the attachement for clarification I need to open the next tab automatically...Thanks Shureshwhat do u need to do now? If im geussing right u want it to show a differnt tab on startup or wenever jus us this:GUICtrlSetState($TabVar , $GUI_SHOW) Edited July 4, 2008 by tlokz
enaiman Posted July 4, 2008 Posted July 4, 2008 The easiest way is to send a "RIGHT" key and that will open your next tab. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
TehWhale Posted July 4, 2008 Posted July 4, 2008 The easiest way is to send a "RIGHT" key and that will open your next tab.What if your focused on an input box? It won't work. The post before yours will.
enaiman Posted July 4, 2008 Posted July 4, 2008 What if your focused on an input box? It won't work. The post before yours will.Take a close look at the picture attached and you will see that the tab IS highlighted ... and it will work always (even when you can't get the tab handle).The previous post assumed that either you can get the tab handle either the GUI was created by AutoIt ... SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
MrCreatoR Posted July 4, 2008 Posted July 4, 2008 Look at _GUICtrlTab_GetCurSel() / _GUICtrlTab_SetCurSel()...expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiTab.au3> $GUI = GUICreate("Test Script", 300, 200) $hTab = GUICtrlCreateTab(20, 10, 260, 150) $Tab1 = GUICtrlCreateTabItem("Tab1") $Tab2 = GUICtrlCreateTabItem("Tab2") $Tab3 = GUICtrlCreateTabItem("Tab3") ;GUICtrlSetState($Tab2, $GUI_SHOW) GUICtrlCreateTabItem("") $Switch_Button = GUICtrlCreateButton("Switch Next", 20, 170, 80, 20) GUISetState(@SW_SHOW, $GUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Switch_Button $iCurrent_TabIndex = _GUICtrlTab_GetCurSel($hTab) $iNext_TabIndex = $iCurrent_TabIndex Switch $iCurrent_TabIndex Case 0, 1 $iNext_TabIndex += 1 Case 2 $iNext_TabIndex = 0 EndSwitch _GUICtrlTab_SetCurSel($hTab, $iNext_TabIndex) EndSwitch WEnd Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
MrCreatoR Posted July 4, 2008 Posted July 4, 2008 And for the external usage: expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiTab.au3> $GUI = GUICreate("Test Script", 300, 200) $hTab = GUICtrlCreateTab(20, 10, 260, 150) $Tab1 = GUICtrlCreateTabItem("Tab1") $Tab2 = GUICtrlCreateTabItem("Tab2") $Tab3 = GUICtrlCreateTabItem("Tab3") GUICtrlCreateTabItem("") $Switch_Button = GUICtrlCreateButton("Switch Next", 20, 170, 80, 20) GUISetState(@SW_SHOW, $GUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Switch_Button ;This handle can by taken from any window that have standard SysTabControl $hWnd_Tab = ControlGetHandle("Test Script", "", "SysTabControl321") _GUICtrlTab_SwitchNext($hWnd_Tab) EndSwitch WEnd Func _GUICtrlTab_SwitchNext($hWnd) Local $iItems_Count = _GUICtrlTab_GetItemCount($hWnd) Local $iCurrent_TabIndex = _GUICtrlTab_GetCurSel($hWnd) Local $iNext_TabIndex = $iCurrent_TabIndex Switch $iCurrent_TabIndex Case 0 To $iItems_Count-2 $iNext_TabIndex += 1 Case Else $iNext_TabIndex = 0 EndSwitch _GUICtrlTab_SetCurSel($hWnd, $iNext_TabIndex) EndFunc Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Shuresh Posted July 8, 2008 Author Posted July 8, 2008 That is not created using Autoit GUI, and its thrid party software, I want to automate to move to next tab to set the parameter to display in screen.So using Autoit I dono how to go next tab... becoz in Visible information I am not able to find any handle to control the swtiching of Tabs.. Since I am a starter pls help me out in this regards...Thanks in AdvanceShureshwhat do u need to do now? If im geussing right u want it to show a differnt tab on startup or wenever jus us this:GUICtrlSetState($TabVar , $GUI_SHOW)
enaiman Posted July 8, 2008 Posted July 8, 2008 Have you read all the posts? I already gave you a simple solution for that: Get your tab control highlited (as it is shown in the image you posted) and send a "RIGHT" key to that application. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
AdmiralAlkex Posted July 8, 2008 Posted July 8, 2008 (edited) Have you tried Send() or ControlSend() with ctrl+tab? Edited July 8, 2008 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
MrCreatoR Posted July 8, 2008 Posted July 8, 2008 Have you tried what i posted? replace "My Title" with your window title, and try it: #include <GuiTab.au3> $hWnd_Tab = ControlGetHandle("My Title", "", "SysTabControl321") _GUICtrlTab_SwitchNext($hWnd_Tab) Func _GUICtrlTab_SwitchNext($hWnd) Local $iItems_Count = _GUICtrlTab_GetItemCount($hWnd) Local $iCurrent_TabIndex = _GUICtrlTab_GetCurSel($hWnd) Local $iNext_TabIndex = $iCurrent_TabIndex Switch $iCurrent_TabIndex Case 0 To $iItems_Count-2 $iNext_TabIndex += 1 Case Else $iNext_TabIndex = 0 EndSwitch _GUICtrlTab_SetCurSel($hWnd, $iNext_TabIndex) EndFunc Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
ph0tix Posted January 25, 2011 Posted January 25, 2011 Hi all, I've implemented the following code in one of my scripts. It successfully selects the tab itself - but the contents of the tab do not actually update. In other words - if I start on Tab 1, and then change to Tab2, Tab2 will appear selected but the contents of Tab1 stay visible. I've tried _WinAPI_RedrawWindow to see if that would help, but it appears not to. Any thoughts? Thanks! Have you tried what i posted? replace "My Title" with your window title, and try it: #include <GuiTab.au3> $hWnd_Tab = ControlGetHandle("My Title", "", "SysTabControl321") _GUICtrlTab_SwitchNext($hWnd_Tab) Func _GUICtrlTab_SwitchNext($hWnd) Local $iItems_Count = _GUICtrlTab_GetItemCount($hWnd) Local $iCurrent_TabIndex = _GUICtrlTab_GetCurSel($hWnd) Local $iNext_TabIndex = $iCurrent_TabIndex Switch $iCurrent_TabIndex Case 0 To $iItems_Count-2 $iNext_TabIndex += 1 Case Else $iNext_TabIndex = 0 EndSwitch _GUICtrlTab_SetCurSel($hWnd, $iNext_TabIndex) EndFunc
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