youtuber Posted September 22, 2017 Share Posted September 22, 2017 Hi friends I would like to change the theme with the help of a button expandcollapse popup#include "MetroGUI-UDF\MetroGUI_UDF.au3" #include <Array.au3> Global $aAraayList[18] = ["LightTeal", "DarkTeal", "DarkMidnight", "DarkBlue", "DarkBlueV2", "LightCyan", "DarkCyan", "LightGray", "LightGreen", "DarkGreen", "LightRed", "DarkGray", "DarkAmber", "LightOrange", "DarkOrange", "LightPurple", "DarkPurple", "LightPink"] Global $List = 0 _SetTheme(_ThemeChange()) $Form1 = _Metro_CreateGUI("Form1", 428, 258, -1, -1, True) $Control_Buttons = _Metro_AddControlButtons(True, True, True, True, True) $GUI_CLOSE_BUTTON = $Control_Buttons[0] $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] $GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] $GUI_MENU_BUTTON = $Control_Buttons[6] $ButtonSetTheme = _Metro_CreateButton("ButtonSet", 80, 160, 75, 25) $ButtonChangeTheme = _Metro_CreateButton("ButtonChange", 240, 160, 75, 25) GUISetState(@SW_SHOW) While 1 _Metro_HoverCheck_Loop($Form1) Sleep(10) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON _Metro_GUIDelete($Form1) Exit Case $GUI_MAXIMIZE_BUTTON GUISetState(@SW_MAXIMIZE) Case $GUI_RESTORE_BUTTON GUISetState(@SW_RESTORE) Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE) Case $GUI_FULLSCREEN_BUTTON, $GUI_FSRestore_BUTTON _Metro_FullscreenToggle($Form1, $Control_Buttons) Case $ButtonSetTheme $VarTema = RegRead('HKCU\Software\MetroGui\Tema', 'Set') _ThemeChange($VarTema) Case $ButtonChangeTheme RegWrite('HKCU\Software\MetroGui\Tema', 'Set','REG_SZ', _ThemeChange()) EndSwitch WEnd Func _ThemeChange($aAraayList[$List]) If $List >= UBound($aAraayList) Then $List = 0 $List += 1 Return $aAraayList[$List] EndFunc Theme: oceanwind 1 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 22, 2017 Moderators Share Posted September 22, 2017 Good for you, hope it goes well If this post seems lacking in assistance, it is because yours is lacking a description of what trouble you're having, unless you're simply asking for someone to do it for you "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
youtuber Posted September 22, 2017 Author Share Posted September 22, 2017 I do not full understand what you're saying. Because my language is Turkish Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 22, 2017 Moderators Share Posted September 22, 2017 I am saying you point out what you want, not where you are running into problems. Explain in detail where you are having difficulty. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
youtuber Posted September 22, 2017 Author Share Posted September 22, 2017 ok. How can I change the theme instantly with the button? Link to comment Share on other sites More sharing options...
argumentum Posted November 7, 2017 Share Posted November 7, 2017 On 9/22/2017 at 2:45 PM, youtuber said: ok. How can I change the theme instantly with the button? yes. in "MetroGUI UDF v5.1 - Windows 10 style buttons, toggles, radios, menu etc." there is an example that does change the theme. Just create a button and assign a function to change it ( I will not show an example ). If you solved it, share your solution ( code example ), as it serves everyone watching this posting. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. 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