Madza91 Posted July 25, 2008 Share Posted July 25, 2008 Hello How to made this: on right click on Tab Item to be focused that item... ? #include <GUIConstantsEx.au3> #include <TabConstants.au3> $gui = GUICreate("My GUI Context Menu", 400, 300) $Tab1 = GUICtrlCreateTab(100, 10, 129, 200) $buttoncontext2 = GUICtrlCreateContextMenu($Tab1) $buttonitem = GUICtrlCreateMenuItem("Close Tab", $buttoncontext2) $item1 = GUICtrlCreateTabItem("Tab 1") $item2 = GUICtrlCreateTabItem("Tab 2") GUICtrlCreateTabItem("") GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) Link to comment Share on other sites More sharing options...
billthecreator Posted July 25, 2008 Share Posted July 25, 2008 (edited) try this... [not tested] If ControlClick ( "My GUI Context Menu", "", $item2,"right") = 1 then GUICtrlSetState($item2, $GUI_SHOW) endif Edited July 25, 2008 by billthecreator [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
rasim Posted July 25, 2008 Share Posted July 25, 2008 n3nE How to made this: on right click on Tab Item to be focused that item... ?Try this: expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiTab.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> $gui = GUICreate("My GUI Context Menu", 400, 300) $Tab1 = GUICtrlCreateTab(100, 10, 129, 200) $buttoncontext2 = GUICtrlCreateContextMenu($Tab1) $buttonitem = GUICtrlCreateMenuItem("Close Tab", $buttoncontext2) $item1 = GUICtrlCreateTabItem("Tab 1") $item2 = GUICtrlCreateTabItem("Tab 2") GUICtrlCreateTabItem("") GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) Local $tNMHDR, $iIDFrom, $iCode $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $iIDFrom Case $Tab1 Switch $iCode Case $NM_RCLICK $tPOINT = _WinAPI_GetMousePos(True, $gui) Local $iX = DllStructGetData($tPOINT, "X") Local $iY = DllStructGetData($tPOINT, "Y") Local $aPos = ControlGetPos($gui, "", $Tab1) Local $aHit = _GUICtrlTab_HitTest($Tab1, $iX - $aPos[0], $iY - $aPos[1]) If $aHit[0] <> -1 Then _GUICtrlTab_SetCurSel($Tab1, $aHit[0]) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Link to comment Share on other sites More sharing options...
Madza91 Posted July 25, 2008 Author Share Posted July 25, 2008 Rasim, so perfect, thx [quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :) 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