bordomavi Posted July 27, 2014 Share Posted July 27, 2014 $TabSheet1 = GUICtrlCreateTabItem("a") $Button1 = GUICtrlCreateButton("aaaaa", 16, 192, 225, 41) Dim $Form1_AccelTable[1][2] = [["{ENTER}", $Button1]] GUISetAccelerators($Form1_AccelTable) $TabSheet2 = GUICtrlCreateTabItem("b") $Button2 = GUICtrlCreateButton("bbbbb", 16, 192, 225, 41) Dim $Form1_AccelTable[1][2] = [["{ENTER}", $Button2]] GUISetAccelerators($Form1_AccelTable) $TabSheet3 = GUICtrlCreateTabItem("c") $Button3 = GUICtrlCreateButton("ccccc", 16, 192, 225, 41) Dim $Form1_AccelTable[1][2] = [["{ENTER}", $Button3]] GUISetAccelerators($Form1_AccelTable) Enter hotkey is working only first tab. i want it work all tab. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 27, 2014 Moderators Share Posted July 27, 2014 bordomavi,How about this? expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cTab = GUICtrlCreateTab(10, 10, 480, 480) $TabSheet1 = GUICtrlCreateTabItem("a") $Button1 = GUICtrlCreateButton("1", 16, 192, 225, 41) $TabSheet2 = GUICtrlCreateTabItem("b") $Button2 = GUICtrlCreateButton("2", 16, 192, 225, 41) $TabSheet3 = GUICtrlCreateTabItem("c") $Button3 = GUICtrlCreateButton("3", 16, 192, 225, 41) GUICtrlCreateTabItem("") $Button_All = GUICtrlCreateDummy() GUISetState() Global $Form1_AccelTable[1][2] = [["{ENTER}", $Button_All]] GUISetAccelerators($Form1_AccelTable) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 MsgBox($MB_SYSTEMMODAL, "Hi", "Button 1 Pressed") Case $Button2 MsgBox($MB_SYSTEMMODAL, "Hi", "Button 2 Pressed") Case $Button3 MsgBox($MB_SYSTEMMODAL, "Hi", "Button 3 Pressed") Case $Button_All $iTab = GUICtrlRead($cTab) + 1 MsgBox($MB_SYSTEMMODAL, "Hi", "Button " & $iTab & " pressed" & @CRLF & "using Accel key") EndSwitch WEndAll clear? M23 232showtime 1 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 Link to comment Share on other sites More sharing options...
bordomavi Posted July 27, 2014 Author Share Posted July 27, 2014 No it is good idea but not works for me. i create some works in tab1 and when i press enter key it goes case $button_all. doesn't do my work. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 27, 2014 Moderators Share Posted July 27, 2014 bordomavi,So you have to create some additional functions which are called by the buttons and the dummy when the correct tab is active: expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cTab = GUICtrlCreateTab(10, 10, 480, 480) $TabSheet1 = GUICtrlCreateTabItem("a") $Button1 = GUICtrlCreateButton("1", 16, 192, 225, 41) $TabSheet2 = GUICtrlCreateTabItem("b") $Button2 = GUICtrlCreateButton("2", 16, 192, 225, 41) $TabSheet3 = GUICtrlCreateTabItem("c") $Button3 = GUICtrlCreateButton("3", 16, 192, 225, 41) GUICtrlCreateTabItem("") $Button_All = GUICtrlCreateDummy() GUISetState() Global $Form1_AccelTable[1][2] = [["{ENTER}", $Button_All]] GUISetAccelerators($Form1_AccelTable) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Button1 _Button_1() Case $Button2 _Button_2() Case $Button3 _Button_3() Case $Button_All Switch GUICtrlRead($cTab) Case 0 _Button_1(1) Case 1 _Button_2(1) Case 2 _Button_3(1) EndSwitch EndSwitch WEnd Func _Button_1($iDummy = 0) $sMsg = "Button 1 Pressed" If $iDummy Then $sMsg &= @CRLF & "using Accel key" MsgBox($MB_SYSTEMMODAL, "Hi", $sMsg) EndFunc Func _Button_2($iDummy = 0) $sMsg = "Button 2 Pressed" If $iDummy Then $sMsg &= @CRLF & "using Accel key" MsgBox($MB_SYSTEMMODAL, "Hi", $sMsg) EndFunc Func _Button_3($iDummy = 0) $sMsg = "Button 3 Pressed" If $iDummy Then $sMsg &= @CRLF & "using Accel key" MsgBox($MB_SYSTEMMODAL, "Hi", $sMsg) EndFuncHow about that? M23 232showtime 1 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 Link to comment Share on other sites More sharing options...
bordomavi Posted July 27, 2014 Author Share Posted July 27, 2014 Yes working thanks Link to comment Share on other sites More sharing options...
232showtime Posted July 27, 2014 Share Posted July 27, 2014 bordomavi, So you have to create some additional functions which are called by the buttons and the dummy when the correct tab is active: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cTab = GUICtrlCreateTab(10, 10, 480, 480) $TabSheet1 = GUICtrlCreateTabItem("a") $Button1 = GUICtrlCreateButton("1", 16, 192, 225, 41) $TabSheet2 = GUICtrlCreateTabItem("b") $Button2 = GUICtrlCreateButton("2", 16, 192, 225, 41) $TabSheet3 = GUICtrlCreateTabItem("c") $Button3 = GUICtrlCreateButton("3", 16, 192, 225, 41) GUICtrlCreateTabItem("") $Button_All = GUICtrlCreateDummy() GUISetState() Global $Form1_AccelTable[1][2] = [["{ENTER}", $Button_All]] GUISetAccelerators($Form1_AccelTable) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit %2 ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. 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