[Need Help] Progressbar / Zufällige Anzeige

08/13/2011 19:07 SIEG.BERT#1
Hallo epvp,
ich würde gerne wissen wie man eine Progressbar erstellt die bei jedem neuen Knopdruck zufällig "lang" wird.
D.h. beim ersten mal erreicht die Progressbar ein Status von 14%, beim 2. mal 49%, beim 3. 11%, usw. Also immer Zufällig.

Danke für alle hilfreichen Antworten.

LG
08/13/2011 19:10 omer36#2
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"414111192124)
$Progress1 GUICtrlCreateProgress(161637725)
$Button1 GUICtrlCreateButton("Button1"1526410533$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            GUICtrlSetData
($Progress1Random(1100))
    EndSwitch
WEnd 
08/13/2011 19:13 Freddy​#3
Hier n ganz kleines beispiel es gaht besser:

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>


$Form1 GUICreate("Form1"23291192124)
$Progress1 GUICtrlCreateProgress(8820933)
$Button1 GUICtrlCreateButton("Button1"72567525$WS_GROUP)
GUISetState(@SW_SHOW)


While 
1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            GUICtrlSetData
($Progress1Random(1100))
    EndSwitch
WEnd 
€: Sry omer war schneller
08/13/2011 19:19 SIEG.BERT#4
Danke,
und wie kann ich jetzt den Wert der Progressbar auslesen und z.B. in Label1 ausgeben.

LG
08/13/2011 19:27 omer36#5
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"30085192124)
$Progress1 GUICtrlCreateProgress(161626517)
$Button1 GUICtrlCreateButton("Button1"56568925$WS_GROUP)
$Label1 GUICtrlCreateLabel(""168565224)
GUICtrlSetFont(-1124000"MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            GUICtrlSetData
($Progress1Random(1100))
    EndSwitch
    If 
GUICtrlRead($Progress1) <> GUICtrlRead($Label1Then GUICtrlSetData($Label1GUICtrlRead($Progress1))
WEnd