Progess mit Integrierter % Anzeige

  • Hallo Community

    ich hätte nur ne kurze frage am rande......ist es möglich in die Progess direkt die %-Anzeige zu integrieren ???


    Is zwa nur ne optische spielerei aber trotztdem sieht das programm dann noch nen bissel besser aus.


    Diesmal hat das ganze keine eile also Zeit lassen und hoffentlich gute Antworten Posten :D :D

  • schonmal probiert ein label drüberzusetzen?

    ist bloß wichtig, dass du nur die Schrift drübersetzt, da gibts so nen speziellen style..ich werde mich nochmal melden wenn ich ihn gefunden habe

    /edit soo schnell gefunden...also wichtig ist noch dass du das label nach der progressbar erstellst, darunter schreibst du dann
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

  • habs jetz auch nochmal probiert..funktioniert leider nicht...evtl gehts mit GDI+ .. habe neulich auch eine GDI+ Progress UDF gesehen, da waren wenn ich mich nicht täuche auch prozentfortschritte drinne, aber ich finde sie nicht mehr..vlt weiß jemand aus dem forum was ich meine

  • Spoiler anzeigen
    [autoit]

    #include <staticconstants.au3>
    #include <guiconstants.au3>
    GUICreate("a", 200, 30)
    $pro = GUICtrlCreateProgress(10, 5, 180, 20)
    $lbl = GUICtrlCreateLabel("", 10, 8, 180, 17, $SS_CENTER)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUISetState()

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

    For $i = 1 To 100
    GUICtrlSetData($pro, $i)
    GUICtrlSetData($lbl, $i&"%")
    Sleep(100)
    Next

    [/autoit]
    • Offizieller Beitrag

    habs jetz auch nochmal probiert..funktioniert leider nicht...evtl gehts mit GDI+ .. habe neulich auch eine GDI+ Progress UDF gesehen, da waren wenn ich mich nicht täuche auch prozentfortschritte drinne, aber ich finde sie nicht mehr..vlt weiß jemand aus dem forum was ich meine

    Du sucht bestimmt das: Progressbar mit GDIplus

  • danke Raupi...genau die hab ich gemeint...die wollte ich mir eh nochmal runterladen weil ich es echt genial finde

  • für downloads per inetget hab ich auch mal was mit progressbar gebastelt:

    [autoit]


    #include <WindowsConstants.au3>
    $uplog = FileSelectFolder("Ordner wählen... ", "")
    if stringlen ($uplog) > 3 then $uplog &= "\"
    if stringinstr ($uplog, ":\") = 0 then
    $uplog = 0
    msgbox(64,"Test","Vorgang auf Wunsch abgebrochen.")
    exit
    endif
    $download = InetGetSize ( "ftp://software.t-online.de/pub/service/to60/T-Online_6.0.exe", 1 )
    $Form1 = GUICreate("Test", 300, 120)
    $Button1 = GUICtrlCreateButton("Bitte warten...", 100, 10, 100, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(20, 55, 260, 25)
    $label1 = GUICtrlCreatelabel("T-Online_6.0.exe", 21, 38, 260, 15 )
    $label2 = GUICtrlCreatelabel("0 KB von " & int($download/1024) & " KB", 21, 84, 260, 15 )
    GUISetState(@SW_SHOW)
    Opt("GuiOnEventMode", 0)
    if $download > 0 then
    $update = InetGet ( "ftp://software.t-online.de/pub/service/to60/T-Online_6.0.exe", $uplog & "T-Online_6.0.exe", 1, 1)
    local $sofar, $diff2
    GUICtrlSetData($button1,"abbrechen")
    do
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Button1
    InetClose($update)
    msgbox(64,"Test","Vorgang auf Wunsch abgebrochen.")
    GUICtrlSetData($button1,".")
    EndSwitch
    $sofar=InetGetInfo($update, 0)
    sleep(50)
    $diff2=InetGetInfo($update, 0)
    GUICtrlSetData($Progress1, int(($sofar/$download)*100))
    GUICtrlSetData($label2, int($sofar/1024) & " KB von " & int($download/1024) & " KB (" & round(($diff2-$sofar)/51.2, 1) & " KB/s)")
    if InetGetInfo($update, 2) then GUICtrlSetData($button1,".")
    until GUICtrlRead ($button1) = "."
    GUIDelete($form1)
    endif

    [/autoit]

    das mit dem t-online ist jetzt nur ne beispieldatei.
    achtung: code ist in 3.3.1.6 beta geschrieben.