Beispiele
Übersicht
Beispiele 1
Beispiele 2
Beispiele 4
Beispiele 5
Beispiele 6
Beispiele 7
Erweiterungen
 

ProgressBarGadget


#Include Once "window9.bi" 'OpenWindow ("Titel", links oben x, y, Breite, Hoehe, Stil, Style) As HWND OpenWindow("Nr. 6",30,30,300,150) 'ProgressBarGadget(gadget, x, y, Breite, Hoehe, BeginPos, EndPos) As HWND ProgressBarGadget(1,10,10,250,30,0,59) SetGadgetState(1,40) Do 'warte auf "Fenster schließen" Loop Until WaitEvent= EventClose

ProgressBarGadget und SetXProgressBarColor


#Include Once "window9.bi" Function zeit As String Dim t As SYSTEMTIME GetLocalTime(@t) function=Right("0"+Str(t.wHour),2)+":"+ _ Right("0"+Str(t.wMinute),2)+":"+ _ Right("0"+Str(t.wSecond),2) End Function Var hwnd = OpenWindow("Nr. 6a",30,30,300,200,WS_VISIBLE Or WS_SYSMENU) WindowColor(hwnd, BGR(200,200,255))'Rot Grün Blau CenterWindow(hwnd) TextGadget(11,50,20,200,55,zeit,SS_CENTER Or SS_SUNKEN) SetGadgetFont(11,Cast(Integer,LoadFont("arial",36))) Dim As Integer Timer1 SetTimer(hwnd, Timer1, 1000, NULL) 'ProgressBarGadget(gadget, x, y, Breite, Hoehe, BeginPos, EndPos, Style) As HWND ProgressBarGadget(12,10,100,280,30,0,59,PBS_SMOOTH)'PBS_SMOOTH, PBS_VERTICAL SetGadgetColor(12,0,BGR(255,50,50),3)'Farbe rot 'only Vista Style grün 1, rot 2, gelb 3 SetXProgressBarColor(12,2) Do Var event=WindowEvent() If event=EventClose Then KillTimer(hwnd, Timer1) End EndIf If event=EventTimer Then SetGadgetText(11,zeit) SetGadgetState(12,Val(Right(zeit,2)))'Sekunden EndIf Loop

TrackBarGadget


#Include Once "window9.bi" Var hwnd = OpenWindow("Nr. 6b",30,30,300,200,WS_VISIBLE Or WS_SYSMENU) WindowColor(hwnd, BGR(200,200,255))'Rot Grün Blau CenterWindow(hwnd) 'TrackBarGadget (gadget, x, y, Breite, Hoehe, min, max, style) As HWND TrackBarGadget(11, 10, 20, 270, 40, 0, 100, 4) 'ProgressBarGadget(gadget, x, y, Breite, Hoehe, BeginPos, EndPos) As HWND ProgressBarGadget(12, 10, 100, 270, 20, 0, 100) Do Var event=WindowEvent() If event=EventClose Then End If event=EventGadget Then Select Case EventNumber Case 11 : SetGadgetState(12, GetTrackBarPos(11)) End Select EndIf Loop

SetXProgressBarColor


3 Farben Status der ProgressBar
#define PBM_SETSTATE &h410 'WM_USER+16 #define PBST_NORMAL 1 #define PBST_ERROR 2 #define PBST_PAUSED 3 'only Vista Style grün 1, rot 2, gelb 3 Function SetXProgressBarColor(ByVal gadget As Integer, _ ByVal farbe As Integer) As Integer Export Return SendMessage(GadgetID(gadget),WM_USER+16,farbe,0) End Function