B4J Question Form Click?

Is there a method for Form_Click?

Ive tried;

Sub Form_Click()
Sub Form_Action()
Sub MainForm_Click()

....... just cant find the right syntax
 

eurojam

Well-Known Member
Licensed User
Longtime User
B4X:
Sub MainForm_MouseClicked (EventData As MouseEvent)
   Log(EventData)
End Sub
 
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
In the future, type "Sub", then press the Space key and then the Tab key (you'll be prompted to press the Tab key by the IDE) and you will get a list of classes exposing Events. Choose the class you want (in this case, it would have been Form) and you'll see the Events exposed. Then you just have to fill in the event name prefix.
 
Upvote 0

eurojam

Well-Known Member
Licensed User
Longtime User

but it is interesting, that the MouseClicked-Event will not be exposed in that way...from the internal designer, right mouseklick->generate it will be exposed...is this a bug?
 
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
That's correct. The _MouseClicked() event doesn't belong to the Form, it belongs to the Form's RootPane member, of type AnchorPane. You'd want to type "Sub", then Space, then Tab and then select "AnchorPane" from the auto-complete menu. There, you'll see the _MouseClicked() event exposed.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…