GUICtrlCreateLabel immer im vordergrund

  • hi habe kleines problem und zwar versuch ich den "Text" von GUICtrlCreateLabel im Vordergrund zu bekommen

    aber irgendwie klappt nix

    [autoit]

    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form2", 413, 56, 303, 219)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
    $Progress1 = GUICtrlCreateProgress(3, 3, 406, 49, $PBS_SMOOTH)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x00FF00)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 7)
    $progress_in = GUICtrlCreateLabel("Text",200, 23, 84, 17 ,$GUI_ONTOP,$GUI_ONTOP)
    GuiCtrlSetState($progress_in,$GUI_ONTOP)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit]

    $Status = "Plus"
    While 1
    $ProgressRead = GUICtrlRead($Progress1)
    If $Status = "Plus" Then
    GUICtrlSetData($Progress1, $ProgressRead + 1)
    If $ProgressRead = 100 Then $Status = "Minus"
    ElseIf $Status = "Minus" Then
    GUICtrlSetData($Progress1, $ProgressRead - 1)
    If $ProgressRead = 0 Then $Status = "Plus"
    EndIf
    Sleep (15)
    $nMSG = GUIGetMsg()
    Switch $nMSG
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von axel2 (14. Mai 2009 um 14:57)

    • Offizieller Beitrag

    Hi,

    dabei wirst du wahrscheinlich immer ein leichtes Flackern feststellen.

    [autoit]

    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    Dim $i, $count, $bar, $lblproz

    [/autoit][autoit][/autoit][autoit]

    GUICreate("Progresstest", 220, 100)
    $bar = GUICtrlCreateProgress(10, 15, 200, 20, $PBS_SMOOTH)
    $lblproz = GUICtrlCreateLabel("Text soll sichtbar bleiben", 10, 15, 200, 20, $SS_CENTER)
    ;GUICtrlSetState($lblproz,$GUI_ONTOP)
    GUICtrlSetBkColor($lblproz, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor($lblproz, 0x0000FF)
    GUISetState(@SW_SHOW)

    [/autoit][autoit][/autoit][autoit]

    Sleep(2000)

    [/autoit][autoit][/autoit][autoit]

    While 1
    $msg = GUIGetMsg()
    $count += 1
    If $msg = $GUI_EVENT_CLOSE Or $i = 101 Then ExitLoop
    If $count = 4 Then
    $count = 0
    $i += 1
    _GUICtrlProgressUpdate($bar, $i, $lblproz)
    ElseIf $i = 101 Then
    ExitLoop
    EndIf
    Sleep(20)
    WEnd

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    ;===============================================================================
    ;
    ; Function Name: _GUICtrlProgressUpdate($progress, $value, $Over1 = -1, $Over2 = -1, $Over3 = -1)
    ; Description:: Updates ProgressBar and resets up to three Controls in front of it.
    ; Parameter(s): $progress : Progressbar
    ; $value : Value of the ProgressBar
    ; $Over1 - $Over3 : Optional Controls to set in the foreground
    ; Requirement(s): ?
    ; Return Value(s): Same as GuiCtrlSetData
    ; Author(s): Prog@ndy
    ;
    ;===============================================================================
    ;
    Func _GUICtrlProgressUpdate($progress, $value, $Over1 = -1, $Over2 = -1, $Over3 = -1)
    $ret = GUICtrlSetData($progress, $value)
    If $Over1 Then GUICtrlSetState($Over1, $GUI_ENABLE)
    If $Over2 Then GUICtrlSetState($Over2, $GUI_ENABLE)
    If $Over3 Then GUICtrlSetState($Over3, $GUI_ENABLE)
    Return $ret
    EndFunc ;==>_GUICtrlProgressUpdate

    [/autoit]

    Mega

  • HI!

    Nicht ganz sauber (flackert) aber man sieht den Text.

    Spoiler anzeigen
    [autoit]


    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form2", 413, 56, 303, 219)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)
    $Progress1 = GUICtrlCreateProgress(3, 3, 406, 49, $PBS_SMOOTH)
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, 0x00FF00)
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 7)
    $progress_in = GUICtrlCreateLabel("",200, 23, 84, 17)
    GUICtrlSetBkColor($progress_in, $GUI_BKCOLOR_TRANSPARENT)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    $Status = "Plus"
    While 1
    $ProgressRead = GUICtrlRead($Progress1)
    If $Status = "Plus" Then
    GUICtrlSetData($Progress1, $ProgressRead + 1)
    GUICtrlSetData($progress_in, $ProgressRead) ;Text wird wieder neu gesetzt
    If $ProgressRead = 100 Then $Status = "Minus"
    ElseIf $Status = "Minus" Then
    GUICtrlSetData($Progress1, $ProgressRead - 1)
    GUICtrlSetData($progress_in, $ProgressRead) ;Text wird wieder neu gesetzt
    If $ProgressRead = 0 Then $Status = "Plus"
    EndIf
    Sleep (25)

    $nMSG = GUIGetMsg()
    Switch $nMSG
    Case $GUI_EVENT_CLOSE
    Exit
    EndSwitch
    WEnd

    [/autoit]

    Schon wieder zu langsam ;)

    If not :?: then ?( else :thumbup:

    2 Mal editiert, zuletzt von Concara (12. Mai 2009 um 11:00)