(02-13-2026, 08:48 PM)bplus Wrote: Code: (Select All)
i fail to see an use for this.
also in the example just above. _mousebutton(1) is called twice. it needs to be restricted to loading the value of lb variable.
So lets see what you came up with
Its really interesting how people come up with different solutions to overcome a problem, getting clear of the mousedown signal without unintentional running a sequence a second time, is one of them.
Tannks
bplus and
hsiangch_ong for your reply, i use this code with your change (_Delay .1 before OpenFileDialog) and i change _mousebutton(1) by "lb" in _Printstring" but result is -1
Delay .1_Delay .1
Code: (Select All)
Screen _NewImage(800, 600, 32)
Do
Cls
Line (0, 0)-(799, 599), _RGB32(50, 50, 50), BF
' Bouton "Charger"
Line (300, 250)-Step(200, 50), _RGB32(100, 100, 100), BF
Line (300, 250)-Step(200, 50), _RGB32(200, 200, 200), B
Color _RGB32(255, 255, 255)
_PrintString (350, 268), "CHARGER"
' Affichage état
_PrintString (10, 30), "_MOUSEBUTTON(1) = " + Str$(lb)
' Gestion souris
While _MouseInput: Wend
mx = _MouseX
my = _MouseY
lb = _MouseButton(1)
' CLIC sur bouton Charger
If lb Then
_Delay .1 ' <<<< get clear of the click FIRST!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
If mx >= 300 And mx <= 500 And my >= 250 And my <= 300 Then
filename$ = _OpenFileDialog$("Load", "", "*.*", "Files", 0)
' _Delay 0.1 >>>> move this to the above !!!!!!! line
End If
End If
_Display
_Limit 60
Loop Until InKey$ = Chr$(27)