MerlinEl
01-21-2010, 07:13 AM
MouseUp event
1) when I press the button and leave, then a action is executed, thats right...
2) when I press the button and move mouse cursor out of form, then a action executed
thats not good...
Is there any way to avoid this ?
fn onBtnMouseUp s a =(if a.Button == a.Button.left do format "button up:%\n" s.text)
fn initButtons t =
(
t.controls.addrange \
(
for i = 1 to 4 collect
(
local b = dotNetObject "Button"
b.text = i as string
b.FlatAppearance.BorderSize = 1
b.margin = dotnetobject "padding" 0
dotNet.addEventHandler b "MouseUp" onBtnMouseUp
b
)
)
)
f=dotnetobject "form"
t=dotNetObject "TableLayoutPanel"
initButtons t
f.controls.add(t)
f.show()
1) when I press the button and leave, then a action is executed, thats right...
2) when I press the button and move mouse cursor out of form, then a action executed
thats not good...
Is there any way to avoid this ?
fn onBtnMouseUp s a =(if a.Button == a.Button.left do format "button up:%\n" s.text)
fn initButtons t =
(
t.controls.addrange \
(
for i = 1 to 4 collect
(
local b = dotNetObject "Button"
b.text = i as string
b.FlatAppearance.BorderSize = 1
b.margin = dotnetobject "padding" 0
dotNet.addEventHandler b "MouseUp" onBtnMouseUp
b
)
)
)
f=dotnetobject "form"
t=dotNetObject "TableLayoutPanel"
initButtons t
f.controls.add(t)
f.show()
