How do I get when it hits the screen coordinates

mjcoon

Well-Known Member
Licensed User
How do I get the screen coordinates when Click

I don't think that you are meant to. A click could be the result of touching the screen at one point, sliding the stylus and then lifting it at another point still within the control.

Other events like MouseDown come with screen (or at least wrt control) coordinates because there can be no ambiguity.

Mike.
 

Simontelescopium

Member
Licensed User
Hi all:
How do I get the screen coordinates when Click?
:sign0013:
This will show the position of the mouse when the screen is clicked
B4X:
Sub Globals
   'Declare the global variables here.

End Sub

Sub App_Start
   Form1.Show
End Sub
Sub Form1_MouseDown (x,y)
' x = x coordinate
' y = y coordinate 
Msgbox("X:"&x&" Y:"&y)

End Sub
 

ablenet

New Member
To: mjcoon ,Simontelescopium
thx your reply.

just I mean:
A click could be the result of touching the screen at one point, sliding the stylus and then lifting it at another point still within the control. How do it with basic4ppc?


:sign0013:
 

mjcoon

Well-Known Member
Licensed User
How do it with basic4ppc?

How to do what, exactly? Please describe the effect that you wish to produce.

The distinction that I did not make clear was between two ways of using the stylus:

1) You just click on some control like a button - it does not matter if the stylus slides. Basic4PPC just delivers a "Click" event and the program registers a use of that button.

2) The stylus is used in a geometrical manner for instance to draw. The program then needs pixel co-ordinates and these are obtained by using a MouseDown or MouseUp event, or both.

There is a third use in which the geometry is interpreted by the control and delivered by a special event, such as sliding an adjustment control or choosing from a list. No pixel co-ordinates are delivered to the program for these cases; only the interpretation is returned.

HTH, Mike.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…