Jump to content
xamxxl

GUI Button needs to be hovered above to be seen

Recommended Posts

Hello, 

after many years im trying again to write a small program for our company. 

The function itself is working fine ( GUI is unfinished, i removed the Functions ), when i switch to another menu and back to "Start", the "Start" and "Stop" buttons wont show up until i moved my mouse over it. This problem seems just to appear for the "Start" menu. "Einstellungen" also works fine... 

Any indeas where i made the mistake? Im using MetroGUI UDF v5.1 by BBs19 ( great modern GUI https://www.autoitscript.com/forum/topic/161184-metrogui-udf-v51-windows-10-style-buttons-toggles-radios-menu-etc/ ) 

Opt("GUIOnEventMode", 1)
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 1)
Opt("TrayAutoPause", 0)
Opt("TrayIconHide", 1)

#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/so /rm /pe
#AutoIt3Wrapper_Icon=\\sbs01\global\Max\CorpChat\icon.ico
#Au3Stripper_Ignore_Funcs=_iHoverOn,_iHoverOff,_iMinBtn,_iMaxBtn,_iCloseBtn,_iRestoreBtn,_iFullscreenToggleBtn,_cHvr_CSCP_X64,_cHvr_CSCP_X86,_iControlDelete

#AutoIt3Wrapper_Res_HiDpi=y
; ===============================================================================================================================

#NoTrayIcon
#Include <Constants.au3>
#Include<GUIConstantsEx.au3>
#include <FontConstants.au3>
#include "MetroGUI-UDF\MetroGUI_UDF.au3"
#include "MetroGUI-UDF\_GUIDisable.au3"
#include <GUIConstants.au3>
#include <Notifications.au3>

;=======================================================================GUI===============================================================================
_Metro_EnableHighDPIScaling()

_SetTheme("DarkBlue")


$Form1 = _Metro_CreateGUI("CorpChat", 500, 300, -1, -1, True)


$Control_Buttons = _Metro_AddControlButtons(True, False, True, False, 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]


;=====================================================Variabeln==========================================================================================

    $OptionsName = Iniread("options.ini","Nutzer","Name","" )
    $OptionsBereich = Iniread("options.ini", "Bereich","Bereich","" )
    $OptionsPfad = Iniread("options.ini", "Pfad", "Root","" )
    $OptionsSender = Iniread("options.ini", "Sender" , "JaNein", "")
    $OptionsLizenz = IniRead ("options.ini","Lizenz","Lizenz", "")

;=====================================================Start GUI==========================================================================================


;Start


$Start = _Metro_CreateButton("Start", 110, 245, 115, 40) ;<----------------------------This Button
$Stop = _Metro_CreateButtonEx("Stop", 195+60, 245, 115, 40);<--------------------------and this one

;Wilkommen
$sFont = "Comic Sans Ms"
$Wilkommen = GUICtrlCreateLabel ( "Wilkommen,", 110, 50, 300, 300 )
$Name = GUICtrlCreateLabel ( $OptionsName, 110, 100, 300, 300, $SS_CENTER )
GUICtrlSetFont($Wilkommen, 19, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $Wilkommen, 0xFFFFFF)
GUICtrlSetFont($Name, 19, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $Name, 0xFFFFFF)

;Aktiviert
$FortschrittAktiv = GUICtrlCreateLabel ( "Aktiviert", 0, 180, 500, 30, $SS_CENTER )
GUICtrlSetFont( $FortschrittAktiv, 9, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $FortschrittAktiv, 0x0BAB13 )
GUICtrlSetState ( $FortschrittAktiv, $GUI_HIDE )
GUICtrlSetState ( $FortschrittAktiv, $GUI_DISABLE )

;Deaktiviert
$FortschrittInaktiv = GUICtrlCreateLabel ( "Inaktiv", 0, 180, 500, 30, $SS_CENTER )
GUICtrlSetFont( $FortschrittInaktiv, 9, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $FortschrittInaktiv, 0x6E7170)
GUICtrlSetState ( $FortschrittInaktiv, $GUI_HIDE )
GUICtrlSetState ( $FortschrittInaktiv, $GUI_DISABLE )


;=====================================================Einstellungen GUI==========================================================================================

;Header
$LabelEinstellungen = GUICtrlCreateLabel ( "Einstellungen", 0, 20, 500, 30, $SS_CENTER )
GUICtrlSetFont($LabelEinstellungen, 15, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $LabelEinstellungen, 0xFFFFFF)
GUICtrlSetState ( $LabelEinstellungen, $GUI_HIDE )
GUICtrlSetState ( $LabelEinstellungen, $GUI_DISABLE )


;Nutzer
$LabelNutzer = GUICtrlCreateLabel ( "Nutzer:", 0, 90, 120, 30, $SS_CENTER )
GUICtrlSetFont( $LabelNutzer, 9, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $LabelNutzer, 0xFFFFFF)
GUICtrlSetState ( $LabelNutzer, $GUI_HIDE )
GUICtrlSetState ( $LabelNutzer, $GUI_DISABLE )

$AktuellerNutzer = GUICtrlCreateInput ( $OptionsName, 95+25, 90, 200, 20 )
GUICtrlSetState ( $AktuellerNutzer, $GUI_HIDE )
GUICtrlSetState ( $AktuellerNutzer, $GUI_DISABLE )


;NutzerGruppe
$LabelNutzerGruppe = GUICtrlCreateLabel ( "Nutzergruppe:", 0, 60, 120, 30, $SS_CENTER )
GUICtrlSetFont( $LabelNutzerGruppe, 9, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $LabelNutzerGruppe, 0xFFFFFF)
GUICtrlSetState ($LabelNutzerGruppe, $GUI_HIDE )
GUICtrlSetState ( $LabelNutzerGruppe, $GUI_DISABLE )

$AktuelleGruppe = GUICtrlCreateInput ( "Mischraum", 95+25, 60, 60, 20 )
GUICtrlSetState ( $AktuelleGruppe, $GUI_HIDE )
GUICtrlSetState ( $AktuelleGruppe, $GUI_DISABLE )


;Pfad suchen
$LabelPfad = GUICtrlCreateLabel ( "Ordnerpfad:", 0, 150, 120, 30, $SS_CENTER )
GUICtrlSetFont($LabelPfad, 9, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $LabelPfad, 0xFFFFFF)
GUICtrlSetState ( $LabelPfad, $GUI_HIDE )
GUICtrlSetState ( $LabelPfad, $GUI_DISABLE )

$Suche = _Metro_CreateButton("Ordner", 310+25, 150, 80, 20)
GUICtrlSetState ( $Suche, $GUI_HIDE )
GUICtrlSetState ( $Suche, $GUI_DISABLE )

$Pfad = GUICtrlCreateInput ( $OptionsPfad, 120, 150, 200, 20 )
GUICtrlSetState ( $Pfad, $GUI_HIDE )
GUICtrlSetState ( $Pfad, $GUI_DISABLE )

;Lizenz
$LabelLizenz = GUICtrlCreateLabel ( "Lizenz:", 0, 120, 120, 30, $SS_CENTER )
GUICtrlSetFont($LabelLizenz, 9, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $LabelLizenz, 0xFFFFFF)
GUICtrlSetState ( $LabelLizenz, $GUI_HIDE )
GUICtrlSetState ( $LabelLizenz, $GUI_DISABLE )

$Lizenz = GUICtrlCreateInput ( $OptionsLizenz, 120, 120, 200, 20 )
GUICtrlSetState ( $Lizenz, $GUI_HIDE )
GUICtrlSetState ( $Lizenz, $GUI_DISABLE )

$LizenzPruefen = _Metro_CreateButton("Prüfen", 335, 120, 80, 20)
GUICtrlSetState ( $LizenzPruefen, $GUI_HIDE )
GUICtrlSetState ( $LizenzPruefen, $GUI_DISABLE )


;Autostart
$Autostart = _Metro_CreateOnOffToggle("Autostart An", "Autostart Aus", 110, 190, 130, 30)
GUICtrlSetState ( $Autostart, $GUI_HIDE )
GUICtrlSetState ( $Autostart, $GUI_DISABLE )

;Sender Empfänger
$Sender = _Metro_CreateOnOffToggle("Sender", "Empfänger", 195+60, 190, 150, 30)
GUICtrlSetState ( $Sender, $GUI_HIDE )
GUICtrlSetState ( $Sender, $GUI_DISABLE )

;Zurück
$Zurueck = _Metro_CreateButtonEx("Zurück", 195+60, 245, 115, 40)
GUICtrlSetState ( $Zurueck, $GUI_HIDE )
GUICtrlSetState ( $Zurueck, $GUI_DISABLE )

;Speichern
$Speichern = _Metro_CreateButtonEx("Speichern", 50+60, 245, 115, 40)
GUICtrlSetState ( $Speichern, $GUI_HIDE )
GUICtrlSetState ( $Speichern, $GUI_DISABLE )


;=====================================================Stil & Empfänger GUI==========================================================================================

;Header
$LabelStilEmpfaenger = GUICtrlCreateLabel ( "Stil und Empfänger", 0, 20, 500, 40, $SS_CENTER )
GUICtrlSetFont($LabelStilEmpfaenger, 15, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $LabelStilEmpfaenger, 0xFFFFFF)
GUICtrlSetState ( $LabelStilEmpfaenger, $GUI_HIDE )
GUICtrlSetState ( $LabelStilEmpfaenger, $GUI_DISABLE )

;LabelStil
$LabelStilEmpfaenger1 = GUICtrlCreateLabel ( "Stil", 20, 50, 100, 30, $SS_CENTER )
GUICtrlSetFont($LabelStilEmpfaenger1, 12, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $LabelStilEmpfaenger1, 0xFFFFFF)
GUICtrlSetState ( $LabelStilEmpfaenger1, $GUI_HIDE )
GUICtrlSetState ( $LabelStilEmpfaenger1, $GUI_DISABLE )


;LabelStil2
$LabelStilEmpfaenger2 = GUICtrlCreateLabel ( "Empfänger", 100, 50, 500, 30, $SS_CENTER )
GUICtrlSetFont($LabelStilEmpfaenger2, 12, $FW_NORMAL,  $GUI_FONTITALIC, $sFont)
GUICtrlSetColor( $LabelStilEmpfaenger2, 0xFFFFFF)
GUICtrlSetState ( $LabelStilEmpfaenger2, $GUI_HIDE )
GUICtrlSetState ( $LabelStilEmpfaenger2, $GUI_DISABLE )

;Stil 1
$Stil1 = _Metro_CreateCheckbox("Stil1", 29, 112-30, 125, 30)
GUICtrlSetState ( $Stil1, $GUI_HIDE )
GUICtrlSetState ( $Stil1, $GUI_DISABLE )

;Stil 2
$Stil2 = _Metro_CreateCheckbox("Stil2", 29, 142-30, 125, 30)
GUICtrlSetState ( $Stil2, $GUI_HIDE )
GUICtrlSetState ( $Stil2, $GUI_DISABLE )

;Stil 3
$Stil3 = _Metro_CreateCheckbox("Stil3", 29, 172-30, 125, 30)
GUICtrlSetState ( $Stil3, $GUI_HIDE )
GUICtrlSetState ( $Stil3, $GUI_DISABLE )

;Stil 4
$Stil4 = _Metro_CreateCheckbox("Stil4", 29, 202-30, 125, 30)
GUICtrlSetState ( $Stil4, $GUI_HIDE )
GUICtrlSetState ( $Stil4, $GUI_DISABLE )

;Stil 5
$Stil5 = _Metro_CreateCheckbox("Stil5", 29, 232-30, 125, 30)
GUICtrlSetState ( $Stil5, $GUI_DISABLE )
GUICtrlSetState ( $Stil5, $GUI_HIDE )

;Empfänger 2
$Empfaenger1 = _Metro_CreateCheckbox("Theke", 290, 112-30, 125, 30)
GUICtrlSetState ( $Empfaenger1, $GUI_DISABLE )
GUICtrlSetState ( $Empfaenger1, $GUI_HIDE )

;Empfänger 2
$Empfaenger2 = _Metro_CreateCheckbox("Büro", 290, 142-30, 125, 30)
GUICtrlSetState ( $Empfaenger2, $GUI_DISABLE )
GUICtrlSetState ( $Empfaenger2, $GUI_HIDE )

;Empfänger 3
$Empfaenger3 = _Metro_CreateCheckbox("Lagerleitung", 290, 172-30, 125, 30)
GUICtrlSetState ( $Empfaenger3, $GUI_DISABLE )
GUICtrlSetState ( $Empfaenger3, $GUI_HIDE )

;Empfänger 4
$Empfaenger4 = _Metro_CreateCheckbox("WA", 290, 202-30, 125, 30)
GUICtrlSetState ( $Empfaenger4, $GUI_DISABLE )
GUICtrlSetState ( $Empfaenger4, $GUI_HIDE )

;Empfänger 5
$Empfaenger5 = _Metro_CreateCheckbox("WE", 290, 232-30, 125, 30)
GUICtrlSetState ( $Empfaenger5, $GUI_DISABLE )
GUICtrlSetState ( $Empfaenger5, $GUI_HIDE )


;=====================================================Verlauf==========================================================================================



;=====================================================Über==========================================================================================


GUICtrlSetResizing($Autostart, 768 + 2 + 32)

GUISetState(@SW_SHOW)


GUISetOnEvent($GUI_EVENT_CLOSE, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_CLOSE_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_MAXIMIZE_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_MINIMIZE_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_RESTORE_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($GUI_MENU_BUTTON, "_GUIEvent_ControlButtons")
GUICtrlSetOnEvent($Start, "_GUIEvent_Buttons")
GUICtrlSetOnEvent($Stop, "_GUIEvent_Buttons")
GUICtrlSetOnEvent($Autostart, "_GUIEvent_Toggles")
GUICtrlSetOnEvent($Sender, "_GUIEvent_Toggles")

;Checkbox Check
GUICtrlSetOnEvent($Stil1, "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($Stil2, "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($Stil3, "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($Stil4, "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($Stil5, "_GUIEvent_Checkboxes")

;Empfänger Check
GUICtrlSetOnEvent($Empfaenger1, "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($Empfaenger2, "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($Empfaenger3, "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($Empfaenger4, "_GUIEvent_Checkboxes")
GUICtrlSetOnEvent($Empfaenger5, "_GUIEvent_Checkboxes")


_Notifications_Startup()
GUISetOnEvent($GUI_EVENT_SECONDARYDOWN, "_GUIEvent_SecondaryDown")



;=====================================================While 1==========================================================================================
While 1
    $GUIMsg = GUIGetMsg()

    Switch $GUIMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Start
         _Nachricht1()
         Case $Stop
            _Close1()
         EndSwitch
         _Notifications_CheckGUIMsg($GUIMsg)
WEnd



;=====================================================Menü==========================================================================================

Func _GUIEvent_ControlButtons()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON
            _Metro_GUIDelete($Form1)
            Exit
        Case $GUI_MAXIMIZE_BUTTON
            _GUI_ToTray()
         Case $GUI_MINIMIZE_BUTTON
            _GUI_ToTray()
        Case $GUI_RESTORE_BUTTON
            GUISetState(@SW_RESTORE, $Form1)
        Case $GUI_MENU_BUTTON
            Local $MenuButtonsArray[5] = ["Start", "Einstellungen", "Stil & Empfänger", "Verlauf", "Schließen"]
            Local $MenuSelect = _Metro_MenuStart($Form1, 150, $MenuButtonsArray)

            Switch $MenuSelect

            ;=====================================================Start==========================================================================================
                  Case "0"
                  ;Disable
                    GUICtrlSetState ( $Speichern, $GUI_HIDE )
                    GUICtrlSetState ( $Speichern, $GUI_DISABLE )
                    GUICtrlSetState ( $Zurueck, $GUI_HIDE )
                    GUICtrlSetState ( $Zurueck, $GUI_DISABLE )
                    GUICtrlSetState ( $Autostart, $GUI_HIDE )
                    GUICtrlSetState ( $Autostart, $GUI_DISABLE )
                    GUICtrlSetState ( $Sender, $GUI_HIDE )
                    GUICtrlSetState ( $Sender, $GUI_DISABLE )
                    GUICtrlSetState ( $Suche, $GUI_HIDE )
                    GUICtrlSetState ( $Suche, $GUI_DISABLE )
                    GUICtrlSetState ( $Pfad, $GUI_HIDE )
                    GUICtrlSetState ( $Pfad, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil1, $GUI_HIDE )
                    GUICtrlSetState ( $Stil1, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil2, $GUI_HIDE )
                    GUICtrlSetState ( $Stil2, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil3, $GUI_HIDE )
                    GUICtrlSetState ( $Stil3, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil4, $GUI_HIDE )
                    GUICtrlSetState ( $Stil4, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil5, $GUI_HIDE )
                    GUICtrlSetState ( $Stil5, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger1, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger1, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger2, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger2, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger3, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger3, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger4, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger4, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger5, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger5, $GUI_DISABLE )
                    GUICtrlSetState ( $LabelStilEmpfaenger, $GUI_HIDE )
                    GUICtrlSetState ( $LabelStilEmpfaenger , $GUI_DISABLE )
                    GUICtrlSetState ( $LabelStilEmpfaenger1, $GUI_HIDE )
                    GUICtrlSetState ( $LabelStilEmpfaenger1 , $GUI_DISABLE )
                    GUICtrlSetState ( $LabelStilEmpfaenger2, $GUI_HIDE )
                    GUICtrlSetState ( $LabelStilEmpfaenger2 , $GUI_DISABLE )
                                        GUICtrlSetState ( $Suche, $GUI_HIDE )
                    GUICtrlSetState ( $Suche, $GUI_DISABLE )
                    GUICtrlSetState ( $Pfad, $GUI_HIDE )
                    GUICtrlSetState ( $Pfad, $GUI_DISABLE )
                    GUICtrlSetState ( $Lizenz, $GUI_HIDE )
                    GUICtrlSetState ( $Lizenz, $GUI_DISABLE )
                    GUICtrlSetState ( $LizenzPruefen, $GUI_HIDE )
                    GUICtrlSetState ( $LizenzPruefen, $GUI_DISABLE )
                    GUICtrlSetState ( $Suche, $GUI_HIDE )
                    GUICtrlSetState ( $Suche, $GUI_DISABLE )
                    GUICtrlSetState ( $LabelPfad, $GUI_HIDE )
                    GUICtrlSetState ( $LabelPfad, $GUI_DISABLE )
                    GUICtrlSetState ( $LabelLizenz, $GUI_HIDE )
                    GUICtrlSetState ( $LabelLizenz, $GUI_DISABLE )
                    GUICtrlSetState ( $LabelEinstellungen, $GUI_HIDE )
                    GUICtrlSetState ( $LabelEinstellungen, $GUI_DISABLE )
                    GUICtrlSetState ( $LabelNutzer, $GUI_HIDE )
                    GUICtrlSetState ( $LabelNutzer, $GUI_DISABLE )
                    GUICtrlSetState ( $LabelNutzerGruppe, $GUI_HIDE )
                    GUICtrlSetState ( $LabelNutzerGruppe, $GUI_DISABLE )
                    GUICtrlSetState ( $AktuelleGruppe, $GUI_HIDE )
                    GUICtrlSetState ( $AktuelleGruppe, $GUI_DISABLE )
                    GUICtrlSetState ( $AktuellerNutzer, $GUI_HIDE )
                    GUICtrlSetState ( $AktuellerNutzer, $GUI_DISABLE )


                 ;Enable
                    GUICtrlSetState ( $Stop, $GUI_SHOW )
                    GUICtrlSetState ( $Stop, $GUI_ENABLE )
                    GUICtrlSetState ( $Start, $GUI_SHOW )
                    GUICtrlSetState ( $Start, $GUI_ENABLE )
                    GUICtrlSetState ( $Wilkommen, $GUI_SHOW )
                    GUICtrlSetState ( $Wilkommen, $GUI_ENABLE )
                    GUICtrlSetState ( $Name, $GUI_SHOW )
                    GUICtrlSetState ( $Name, $GUI_ENABLE )



                Case "1"

                   ;=====================================================Einstellungen==========================================================================================

                  ;Disable
                    GUICtrlSetState ( $Start, $GUI_HIDE )
                    GUICtrlSetState ( $Start, $GUI_DISABLE )
                    GUICtrlSetState ( $Stop, $GUI_HIDE )
                    GUICtrlSetState ( $Stop, $GUI_DISABLE )
                    GUICtrlSetState ( $Wilkommen, $GUI_HIDE )
                    GUICtrlSetState ( $Wilkommen, $GUI_DISABLE )
                    GUICtrlSetState ( $Name, $GUI_HIDE )
                    GUICtrlSetState ( $Name, $GUI_DISABLE )
                    GUICtrlSetState ( $Speichern, $GUI_HIDE )
                    GUICtrlSetState ( $Speichern, $GUI_DISABLE )
                    GUICtrlSetState ( $Zurueck, $GUI_HIDE )
                    GUICtrlSetState ( $Zurueck, $GUI_DISABLE )
                    GUICtrlSetState ( $Autostart, $GUI_HIDE )
                    GUICtrlSetState ( $Autostart, $GUI_DISABLE )
                    GUICtrlSetState ( $Sender, $GUI_HIDE )
                    GUICtrlSetState ( $Sender, $GUI_DISABLE )
                    GUICtrlSetState ( $Suche, $GUI_HIDE )
                    GUICtrlSetState ( $Suche, $GUI_DISABLE )
                    GUICtrlSetState ( $Pfad, $GUI_HIDE )
                    GUICtrlSetState ( $Pfad, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil1, $GUI_HIDE )
                    GUICtrlSetState ( $Stil1, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil2, $GUI_HIDE )
                    GUICtrlSetState ( $Stil2, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil3, $GUI_HIDE )
                    GUICtrlSetState ( $Stil3, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil4, $GUI_HIDE )
                    GUICtrlSetState ( $Stil4, $GUI_DISABLE )
                    GUICtrlSetState ( $Stil5, $GUI_HIDE )
                    GUICtrlSetState ( $Stil5, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger1, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger1, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger2, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger2, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger3, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger3, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger4, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger4, $GUI_DISABLE )
                    GUICtrlSetState ( $Empfaenger5, $GUI_HIDE )
                    GUICtrlSetState ( $Empfaenger5, $GUI_DISABLE )
                    GUICtrlSetState ( $LabelStilEmpfaenger, $GUI_HIDE )
                    GUICtrlSetState ( $LabelStilEmpfaenger , $GUI_DISABLE )
                    GUICtrlSetState ( $LabelStilEmpfaenger1, $GUI_HIDE )
                    GUICtrlSetState ( $LabelStilEmpfaenger1 , $GUI_DISABLE )
                    GUICtrlSetState ( $LabelStilEmpfaenger2, $GUI_HIDE )
                    GUICtrlSetState ( $LabelStilEmpfaenger2 , $GUI_DISABLE )

                  ;Enable
                    GUICtrlSetState ( $Speichern, $GUI_SHOW )
                    GUICtrlSetState ( $Speichern, $GUI_ENABLE )
                    GUICtrlSetState ( $Zurueck, $GUI_SHOW )
                    GUICtrlSetState ( $Zurueck, $GUI_ENABLE )
                    GUICtrlSetState ( $Autostart, $GUI_SHOW )
                    GUICtrlSetState ( $Autostart, $GUI_ENABLE )
                    GUICtrlSetState ( $Sender, $GUI_SHOW )
                    GUICtrlSetState ( $Sender, $GUI_ENABLE )
                    GUICtrlSetState ( $Suche, $GUI_SHOW )
                    GUICtrlSetState ( $Suche, $GUI_ENABLE )
                    GUICtrlSetState ( $Pfad, $GUI_SHOW )
                    GUICtrlSetState ( $Pfad, $GUI_ENABLE )
                    GUICtrlSetState ( $Lizenz, $GUI_SHOW )
                    GUICtrlSetState ( $Lizenz, $GUI_ENABLE )
                    GUICtrlSetState ( $LizenzPruefen, $GUI_SHOW )
                    GUICtrlSetState ( $LizenzPruefen, $GUI_ENABLE )
                    GUICtrlSetState ( $Suche, $GUI_SHOW )
                    GUICtrlSetState ( $Suche, $GUI_ENABLE )
                    GUICtrlSetState ( $LabelPfad, $GUI_SHOW )
                    GUICtrlSetState ( $LabelPfad, $GUI_ENABLE )
                    GUICtrlSetState ( $LabelLizenz, $GUI_SHOW )
                    GUICtrlSetState ( $LabelLizenz, $GUI_ENABLE )
                    GUICtrlSetState ( $LabelEinstellungen, $GUI_SHOW )
                    GUICtrlSetState ( $LabelEinstellungen, $GUI_ENABLE )
                    GUICtrlSetState ( $LabelNutzer, $GUI_SHOW )
                    GUICtrlSetState ( $LabelNutzer, $GUI_ENABLE )
                    GUICtrlSetState ( $LabelNutzerGruppe, $GUI_SHOW )
                    GUICtrlSetState ( $LabelNutzerGruppe, $GUI_ENABLE )
                    GUICtrlSetState ( $AktuelleGruppe, $GUI_SHOW )
                    GUICtrlSetState ( $AktuelleGruppe, $GUI_ENABLE )
                    GUICtrlSetState ( $AktuellerNutzer, $GUI_SHOW )
                    GUICtrlSetState ( $AktuellerNutzer, $GUI_ENABLE )



                Case "2"
                       ;=====================================================Stil & Empfänger==========================================================================================


                    ;Disable
                    ;GUIDelete ( $Fortschritt )
                    GUICtrlSetState ( $Start, $GUI_HIDE )
                    GUICtrlSetState ( $Start, $GUI_DISABLE )
                    GUICtrlSetState ( $Stop, $GUI_HIDE )
                    GUICtrlSetState ( $Stop, $GUI_DISABLE )
                    GUICtrlSetState ( $Wilkommen, $GUI_HIDE )
                    GUICtrlSetState ( $Wilkommen, $GUI_DISABLE )
                    ;GUIDelete ( $Wilkommen )
                    GUICtrlSetState ( $Name, $GUI_HIDE )
                    GUICtrlSetState ( $Name, $GUI_DISABLE )
                    ;GUIDelete ( $Name )


                    ;Enable
                    GUICtrlSetState ( $LabelStilEmpfaenger, $GUI_SHOW )
                    GUICtrlSetState ( $LabelStilEmpfaenger, $GUI_ENABLE )
                    GUICtrlSetState ( $LabelStilEmpfaenger1, $GUI_SHOW )
                    GUICtrlSetState ( $LabelStilEmpfaenger1, $GUI_ENABLE )
                    GUICtrlSetState ( $LabelStilEmpfaenger2, $GUI_SHOW )
                    GUICtrlSetState ( $LabelStilEmpfaenger2, $GUI_ENABLE )

                    GUICtrlSetState ( $Stil1, $GUI_SHOW )
                    GUICtrlSetState ( $Stil1, $GUI_ENABLE )
                    GUICtrlSetState ( $Stil2, $GUI_SHOW )
                    GUICtrlSetState ( $Stil2, $GUI_ENABLE )
                    GUICtrlSetState ( $Stil3, $GUI_SHOW )
                    GUICtrlSetState ( $Stil3, $GUI_ENABLE )
                    GUICtrlSetState ( $Stil4, $GUI_SHOW )
                    GUICtrlSetState ( $Stil4, $GUI_ENABLE )
                    GUICtrlSetState ( $Stil5, $GUI_SHOW )
                    GUICtrlSetState ( $Stil5, $GUI_ENABLE )

                    GUICtrlSetState ( $Empfaenger1, $GUI_SHOW )
                    GUICtrlSetState ( $Empfaenger1, $GUI_ENABLE )
                    GUICtrlSetState ( $Empfaenger2, $GUI_SHOW )
                    GUICtrlSetState ( $Empfaenger2, $GUI_ENABLE )
                    GUICtrlSetState ( $Empfaenger3, $GUI_SHOW )
                    GUICtrlSetState ( $Empfaenger3, $GUI_ENABLE )
                    GUICtrlSetState ( $Empfaenger4, $GUI_SHOW )
                    GUICtrlSetState ( $Empfaenger4, $GUI_ENABLE )
                    GUICtrlSetState ( $Empfaenger5, $GUI_SHOW )
                    GUICtrlSetState ( $Empfaenger5, $GUI_ENABLE )


                    ConsoleWrite("Returned 2 = About button clicked." & @CRLF)

                Case "3"
                    ConsoleWrite("Returned 3 = Contact button clicked." & @CRLF)
                Case "4"
                    ConsoleWrite("Returned 4 = Exit button clicked." & @CRLF)
                    _Metro_GUIDelete($Form1)
                    Exit
            EndSwitch
    EndSwitch
EndFunc


;=====================================================Verkleinern==========================================================================================
Func _GUI_ToTray()
    GUISetState(@SW_HIDE, $Form1)
    TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "_GUI_Restore")
    TraySetOnEvent($TRAY_EVENT_SECONDARYUP, "_Quit")
    Opt("TrayIconHide", 0)
    Return $Form1
EndFunc
Func _GUI_Restore()
    GUISetState(@SW_SHOW, $Form1)
    WinActivate($Form1)
    TraySetState(2)
    Opt("TrayIconHide", 1)
 EndFunc



 ;=====================================================Rechtsklick==========================================================================================
Func _GUIEvent_SecondaryDown()
    Local $aCInfo = GUIGetCursorInfo($Form1)
    If $aCInfo[4] = $Button3 Then

        Local $MenuButtonsArray[4] = ["Button 1", "Button 2", "Button 3", "Button 4"]
        Local $MenuSelect = _Metro_RightClickMenu($Form1, 300, $MenuButtonsArray)
        Switch $MenuSelect
            Case "0"
                ConsoleWrite("Returned 0 = Button 1 clicked." & @CRLF)
            Case "1"
                ConsoleWrite("Returned 1 = Button 2 clicked." & @CRLF)
            Case "2"
                ConsoleWrite("Returned 2 = Button 3 clicked." & @CRLF)
            Case "3"
                ConsoleWrite("Returned 3 = Button 4 clicked." & @CRLF)
        EndSwitch
    EndIf
EndFunc



;=====================================================Bei Botton Klick==========================================================================================
Func _GUIEvent_Buttons()
    Switch @GUI_CtrlId
        Case $Start
            $Fortschritt = _Metro_CreateProgress(100, 195, 300, 26)
            GUICtrlSetState ( $FortschrittAktiv, $GUI_SHOW )
            GUICtrlSetState ( $FortschrittAktiv, $GUI_ENABLE )
            For $i = 0 To 100 Step +1
                Sleep(1)
                _Metro_SetProgress($Fortschritt, $i)
            Next
         Case $Stop
            GUICtrlSetState ( $Fortschritt, $GUI_HIDE )
            GUICtrlSetState ( $Fortschritt, $GUI_DISABLE )
            GUICtrlSetState ( $FortschrittInaktiv, $GUI_SHOW )
            GUICtrlSetState ( $FortschrittInaktiv, $GUI_ENABLE )
            IniWrite("1.ini","","","")
    EndSwitch
EndFunc


;=====================================================Bei Toggle Klick==========================================================================================
Func _GUIEvent_Toggles()
    Switch @GUI_CtrlId
        Case $Autostart
            If _Metro_ToggleIsChecked($Autostart) Then
                _Metro_ToggleUnCheck($Autostart)
                ConsoleWrite("Toggle 1 unchecked!" & @CRLF)
            Else
                _Metro_ToggleCheck($Autostart)
                ConsoleWrite("Toggle 1 checked!" & @CRLF)
            EndIf
        Case $Sender
            If _Metro_ToggleIsChecked($Sender) Then
                _Metro_ToggleUnCheck($Sender)
                ConsoleWrite("Toggle 2 unchecked!" & @CRLF)
            Else
                _Metro_ToggleCheck($Sender)
                ConsoleWrite("Toggle 2 checked!" & @CRLF)
            EndIf
    EndSwitch
EndFunc



;=====================================================Bei Checkbox Klick==========================================================================================
Func _GUIEvent_Checkboxes()
    Switch @GUI_CtrlId
        Case $Stil1
            If _Metro_CheckboxIsChecked($Stil1) Then
                _Metro_CheckboxUnCheck($Stil1)
                ConsoleWrite("Checkbox unchecked!" & @CRLF)
            Else
                _Metro_CheckboxCheck($Stil1)
                ConsoleWrite("Checkbox checked!" & @CRLF)
            EndIf
        Case $Stil2
            If _Metro_CheckboxIsChecked($Stil2) Then
                _Metro_CheckboxUnCheck($Stil2)
                ConsoleWrite("Checkbox unchecked!" & @CRLF)
            Else
                _Metro_CheckboxCheck($Stil2)
                ConsoleWrite("Checkbox checked!" & @CRLF)
            EndIf
        Case $Stil3
            If _Metro_CheckboxIsChecked($Stil3) Then
                _Metro_CheckboxUnCheck($Stil3)
            Else
                _Metro_CheckboxCheck($Stil3)
                ConsoleWrite("Checkbox checked!" & @CRLF)
             EndIf
        Case $Stil4
            If _Metro_CheckboxIsChecked($Stil4) Then
                _Metro_CheckboxUnCheck($Stil4)
            Else
                _Metro_CheckboxCheck($Stil4)
                ConsoleWrite("Checkbox checked!" & @CRLF)
             EndIf
         Case $Stil5
            If _Metro_CheckboxIsChecked($Stil5) Then
                _Metro_CheckboxUnCheck($Stil5)
            Else
                _Metro_CheckboxCheck($Stil5)
                ConsoleWrite("Checkbox checked!" & @CRLF)
             EndIf

         Case $Empfaenger1
            If _Metro_CheckboxIsChecked($Empfaenger1) Then
                _Metro_CheckboxUnCheck($Empfaenger1)
            Else
                _Metro_CheckboxCheck($Empfaenger1)
                ConsoleWrite("Checkbox checked!" & @CRLF)
             EndIf
          Case $Empfaenger2
            If _Metro_CheckboxIsChecked($Empfaenger2) Then
                _Metro_CheckboxUnCheck($Empfaenger2)
            Else
                _Metro_CheckboxCheck($Empfaenger2)
                ConsoleWrite("Checkbox checked!" & @CRLF)
             EndIf
          Case $Empfaenger3
            If _Metro_CheckboxIsChecked($Empfaenger3) Then
                _Metro_CheckboxUnCheck($Empfaenger3)
            Else
                _Metro_CheckboxCheck($Empfaenger3)
                ConsoleWrite("Checkbox checked!" & @CRLF)
             EndIf
          Case $Empfaenger4
            If _Metro_CheckboxIsChecked($Empfaenger4) Then
                _Metro_CheckboxUnCheck($Empfaenger4)
            Else
                _Metro_CheckboxCheck($Empfaenger4)
                ConsoleWrite("Checkbox checked!" & @CRLF)
             EndIf
          Case $Empfaenger5
            If _Metro_CheckboxIsChecked($Empfaenger5) Then
                _Metro_CheckboxUnCheck($Empfaenger5)
            Else
                _Metro_CheckboxCheck($Empfaenger5)
                ConsoleWrite("Checkbox checked!" & @CRLF)
            EndIf
    EndSwitch
EndFunc

 

Thanks in advance , 

Max 

Share this post


Link to post
Share on other sites

Your "Welcome" And "Name" Labels i.e. lines 62 and 63

$Wilkommen = GUICtrlCreateLabel ( "Wilkommen,", 110, 50, 300, 300 )
$Name = GUICtrlCreateLabel ( $OptionsName, 110, 100, 300, 300, $SS_CENTER )

Have a height of 300 and they are covering the Start and Stop buttons until hovered over and activated.

Change the heights of these 2 labels to 100 like so

$Wilkommen = GUICtrlCreateLabel ( "Wilkommen,", 110, 50, 300, 100 )
$Name = GUICtrlCreateLabel ( $OptionsName, 110, 100, 300, 100, $SS_CENTER )

And you will see that the buttons appear on the Form without the need of them to be hovered over first.

Edited by sudeepjd

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...