youtuber

Gui theme change question

5 posts in this topic

Hi friends

I would like to change the theme with the help of a button

 

#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:

 

Share this post


Link to post
Share on other sites



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 ;)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I do not full understand what you're saying.
Because my language is Turkish

Share this post


Link to post
Share on other sites

I am saying you point out what you want, not where you are running into problems. Explain in detail where you are having difficulty.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

ok.

How can I change the theme instantly with the button?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now