Image Button control has ButtonDown and ButtonUp events.
Why doesn't simple button have them as well ?
I found it useful to do something continuously while the button is pressed:
B4X:
Sub roll_down
k = StrAt(Sender,4)
roll_flag = 1
Select k
Case 1
Do While roll_flag = 1
rollX(delta)
DoEvents
Loop
...
Sub roll_up
roll_flag = 0
End Sub
From the Door Overview: "You should have some knowledge with the .Net Framework if you want to fully exploit this library."
(I don't)
OK, just tell me what I'm doing wrong here:
B4X:
Sub Globals
' obj is object, BU and BD are events.
End Sub
Sub App_Start
Form1.Show
obj.New1(False)
obj.FromControl("Button1")
BD.New1( obj.Value,"ButtonDown")
BU.New1( obj.Value,"ButtonUp")
End Sub
Sub MD_NewEvent
Msgbox("Button down")
End Sub
Sub MU_NewEvent
Msgbox("Button Up")
End Sub
Klaus
Thanks, It is a solution but if you look at the first post - it is a very complicated solution in comparison to using an image button which does have these events, and I wonder why they do not exist for simple button control.
Also , I don't understand why the door cannot implement the existing events on the button. I understand that this is what the library was created for (to add where B4Ppc does not provide).
Because a Button is a standard .NET Button control but ImageButton is a custom control written by Erel for Basic4ppc. Because of this it has access to the mouse events which a normal Button does not have.
I don't understand why the door cannot implement the existing events on the button.
The Door library can implement any existing events whose EventArgs (the Door Data property) it can understand, which is most events. The events you are referring to do not exist on a .NET Button in the Compact Framework. For some reason known only to Microsoft it has KeyDown, KeyPress and KeyUp events you could implement using a Door Event but none of the mouse events.
I'll state my wish in another way : "My wish is that Erel will create a B4Ppc button that will have the up and down events like those of its privileged brother, the Imagebutton."