rexx Posted August 9, 2009 Share Posted August 9, 2009 I found that ctrl+tab and ctrl+shift+tab not works on tabs created by autoit. It should switch to next/previous tab but it just works like a normal tab, jump to the next control. Is that a bug or there are some options for it? Link to comment Share on other sites More sharing options...
Authenticity Posted August 9, 2009 Share Posted August 9, 2009 expandcollapse popup#include <GUIConstantsEx.au3> #include <TabConstants.au3> Global $hGUI, $Tab, $TabRight, $TabLeft Global $aAccelerator[2][2] Global $aTabs[21] = [20] $hGUI = GUICreate('Test', 400, 500) $Tab = GUICtrlCreateTab(0, 0, 400, 500) $TabRight = GUICtrlCreateDummy() $TabLeft = GUICtrlCreateDummy() For $i = 1 To $aTabs[0] $aTabs[$i] = GUICtrlCreateTabItem('Tab ' & $i) Next GUICtrlCreateTabItem("") $aAccelerator[0][0] = '^{TAB}' $aAccelerator[0][1] = $TabRight $aAccelerator[1][0] = '^+{TAB}' $aAccelerator[1][1] = $TabLeft GUISetAccelerators($aAccelerator, $hGUI) GUISetState() Sleep(1000) While 1 Switch GUIGetMsg() Case $TabRight Local $iIndex = GUICtrlRead($Tab)+1 If $iIndex >= $aTabs[0] Then $iIndex = 0 GUICtrlSendMsg($Tab, $TCM_SETCURSEL, $iIndex, 0) Case $TabLeft Local $iIndex = GUICtrlRead($Tab)-1 If $iIndex < 0 Then $iIndex = $aTabs[0]-1 GUICtrlSendMsg($Tab, $TCM_SETCURSEL, $iIndex, 0) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() Exit Link to comment Share on other sites More sharing options...
rexx Posted August 9, 2009 Author Share Posted August 9, 2009 wow thanks, that's beautiful and it works fine. So it's not a native function of tab control? I thought it was :S Link to comment Share on other sites More sharing options...
rexx Posted August 10, 2009 Author Share Posted August 10, 2009 (edited) Case $TabRight Local $iIndex = GUICtrlRead($Tab)+1 If $iIndex >= $aTabs[0] Then $iIndex = 0 GUICtrlSendMsg($Tab, $TCM_SETCURSEL, $iIndex, 0) It should be $TCM_SETCURFOCUS here to make the content in tab change. SetCurSel only change the selected tab, but not the contents, that's weird. Edited August 10, 2009 by rexx Link to comment Share on other sites More sharing options...
GEOSoft Posted August 10, 2009 Share Posted August 10, 2009 You could also have looked at ControlCommand ( "title", "text", $Tab, "TabRight", "");; Or "TabLeft" depending on the direction you want to go. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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