I can't help myself this time; I have to post up a simple HOW TO for the newbies. Most people on this forum, prepare to roll your eyes and sigh sadly.
For a long time now I've been trying to work out what the EventData is and how to use whatever it does. I've searched and scanned; I've read all of the manuals backwards and forwards, top to bottom and inside out. But nowhere that I can find is there a clear description, in simple words, of what the EventData is and how to access it. But now through sheer perseverance I've finally stumbled on to the answer. Firstly, to find out some information about MouseEvents, go to the documentation here - https://www.b4x.com/guides/B4XBasicLanguage/?page=82
Bet here's the magic that I couldn't find discussed anywhere. In order to extract the various data the event produces, you simply code it like this -
(UPDATE - I have since realised that I did see the EventData.X mentioned in a post, but I didn't recognise what it was trying to tell me. I suppose that's a part of being a newbie)
I expected it would be eye rolling simple when I finally found it, but I didn't expect it to be that simple.
I hope this has been helpful for somebody else out there who has been tearing their hair out ..... like I was.
Alex
For a long time now I've been trying to work out what the EventData is and how to use whatever it does. I've searched and scanned; I've read all of the manuals backwards and forwards, top to bottom and inside out. But nowhere that I can find is there a clear description, in simple words, of what the EventData is and how to access it. But now through sheer perseverance I've finally stumbled on to the answer. Firstly, to find out some information about MouseEvents, go to the documentation here - https://www.b4x.com/guides/B4XBasicLanguage/?page=82
Bet here's the magic that I couldn't find discussed anywhere. In order to extract the various data the event produces, you simply code it like this -
B4X:
Private Sub sample_MouseClicked (EventData As MouseEvent)
X1 = EventData.X
Endsub
(UPDATE - I have since realised that I did see the EventData.X mentioned in a post, but I didn't recognise what it was trying to tell me. I suppose that's a part of being a newbie)
I expected it would be eye rolling simple when I finally found it, but I didn't expect it to be that simple.
I hope this has been helpful for somebody else out there who has been tearing their hair out ..... like I was.
Alex
Last edited: