PlayHD Posted October 26, 2012 Posted October 26, 2012 (edited) hey alli want to create a custom menu like this i already try with _GUICtrlMenu_CreatePopup and _GUICtrlMenu_SetMenuBackground but i don't like it : http://prntscr.com/i8mori dont want to use thanks in advance Edited October 26, 2012 by PlayHD My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit
UEZ Posted October 28, 2012 Posted October 28, 2012 (edited) Here a fast hack: expandcollapse popup;fast hack by UEZ 2012 #include <WindowsConstants.au3> Global $hGUI = GUICreate("Test", 240, 180) Global $idBtn = GUICtrlCreateButton("Menu", 50, 10, 50, 30) GUISetState() Do Switch GUIGetMsg() Case -3 ExitLoop Case $idBtn ShowSubMenu($hGUI, $idBtn) EndSwitch Until 0 GUIDelete() Exit Func ShowSubMenu($hWnd, $idCtrl) Local $aPos = ControlGetPos($hWnd, "", $idCtrl), $a Local $hGUI_Child = GUICreate("", 150, 115, $aPos[0], $aPos[1] + $aPos[3], $WS_POPUP, $WS_EX_MDICHILD, $hWnd) GUISetFont(22) Local $iStdColor = 0x96979B, $iHighlightColor = 0x2F2FDF GUISetBkColor($iStdColor, $hGUI_Child) Local $idLabel1 = GUICtrlCreateLabel("Text 1", 8,0, 136, 33) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $iStdColor) Local $idLabel2 = GUICtrlCreateLabel("Text 2", 8,40, 136, 33) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $iStdColor) Local $idLabel3 = GUICtrlCreateLabel("Text 3", 8,80, 136, 33) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetBkColor(-1, $iStdColor) GUISetState(@SW_SHOW, $hGUI_Child) Local $bL1 = True, $bL2 = True, $bL3 Do $a = GUIGetCursorInfo($hGUI_Child) Switch $a[4] Case $idLabel1 If $bL1 Then GUICtrlSetBkColor($idLabel1, $iHighlightColor) GUICtrlSetBkColor($idLabel2, $iStdColor) GUICtrlSetBkColor($idLabel3, $iStdColor) $bL1 = False $bL2 = True $bL3 = True EndIf Case $idLabel2 If $bL2 Then GUICtrlSetBkColor($idLabel2, $iHighlightColor) GUICtrlSetBkColor($idLabel1, $iStdColor) GUICtrlSetBkColor($idLabel3, $iStdColor) $bL2 = False $bL1 = True $bL3 = True EndIf Case $idLabel3 If $bL3 Then GUICtrlSetBkColor($idLabel3, $iHighlightColor) GUICtrlSetBkColor($idLabel1, $iStdColor) GUICtrlSetBkColor($idLabel2, $iStdColor) $bL3 = False $bL1 = True $bL2 = True EndIf Case Else $bL3 = True $bL1 = True $bL2 = True EndSwitch If $a[2] Then ExitLoop Until False If Not $bL1 Then MsgBox(0, "Test", "Label 1 was selected") If Not $bL2 Then MsgBox(0, "Test", "Label 2 was selected") If Not $bL3 Then MsgBox(0, "Test", "Label 3 was selected") GUIDelete($hGUI_Child) Return 1 EndFunc Br, UEZ Edited October 28, 2012 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
PlayHD Posted October 29, 2012 Author Posted October 29, 2012 (edited) that's look very nice thank you any other examples are appreciated Edited October 29, 2012 by PlayHD My UDF : _WinShake, _WinSplitMy Apps : Google Guitar Bot, PuzzleGameDesign Gui : Interesting Tabs Design, RBox Project (abandoned), Animated Gui on Exit
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