[Gambas-user] Progressbar_mousedown() does not work [solved]

Tobias Boege taboege at ...626...
Mon Nov 17 13:53:06 CET 2014


On Mon, 17 Nov 2014, Fabien Bodard wrote:
> Progressbar is just a drawingarea that dsplay a blue square ....so
> putting a drawingarea  on another is not really the soluce
> 
> You can do :
> 
> 
> ' Gambas class file
> 
> Private OBS As Observer
> 
> 
> Public Sub Form_Open()
> 
>   OBS = New Observer(ProgressBar1.Children[0]) As "OBS"
> 
> End
> 
> 
> Public Sub OBS_MouseDown()
> 
>   ProgressBar1.Value = Mouse.x / ProgressBar1.W
> 
> End
> 

... but note that this solution depends on the ordering of children in the
ProgressBar control, which you have no control over or guarantees about.

Fabien is perfectly right with his answer but if I decide tomorrow to put
another thing into the ProgressBar, the above code may not work any longer.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list