What srod answered is true...
I played with the code to see if I could display the percentage in
real time in the TextGadget while dragging the scrollbar. But no success... Only when I drop the mouse button, the percentage is showed.
The reason is to be able to see
when I should drop the mouse button.
Thanks
Code: Select all
W = 512
H = 384
Win=OpenWindow(#PB_Any,0,0,W,H,"",#PB_Window_ScreenCentered|#PB_Window_MaximizeGadget|#PB_Window_MinimizeGadget|#PB_Window_SizeGadget)
TxGad=TextGadget(#PB_Any,10,40,100,20,"0")
SbGad=ScrollBarGadget(#PB_Any, 10, 10, 480, 17, 0, 100, 25)
Percent=0
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case SbGad
If EventType()=#PB_EventType_LeftClick ;does not work with #PB_EventType_Change
SetGadgetText(TxGad,Str(GetGadgetState(SbGad)))
EndIf
EndSelect
Case #PB_Event_CloseWindow
Quit=1
EndSelect
Until Quit=1
CloseWindow(Win)