Position d'un cursor avec Pocket PC!

cs_AmK Messages postés 368 Date d'inscription jeudi 13 mars 2003 Statut Membre Dernière intervention 27 janvier 2010 - 4 avril 2008 à 00:59
cs_MagDix Messages postés 531 Date d'inscription lundi 5 juin 2006 Statut Membre Dernière intervention 6 octobre 2012 - 8 avril 2008 à 17:13
Bonsoir,


J'aimerais savoir s'il est possible d'avoir la position de l'impact d'un stylet sur une picturebox par exemple.

(je veux intéragir avec une map , mappoint).

( j'ai afficher le help de MSDN il semblerait que la propriété position
ne soit pas dispo sur compact framework , ça serait logique vu que le
stylet ne peut pas survoler la zone . mais , qu'en est il de l'impact ?


Merci !

1 réponse

cs_MagDix Messages postés 531 Date d'inscription lundi 5 juin 2006 Statut Membre Dernière intervention 6 octobre 2012 1
8 avril 2008 à 17:13
Salut...


J'utilise un PictureBox et j'y dessine des éléments.
Il y a un zoom In/Out et donc je peux me déplacer avec le stylet...


Je t'annexe le code.


En espérant que ca pourra t'aider


bye

<hr />
Private
Sub PictureBox1_MouseDown(
ByVal sender
As
Object,
ByVal e
As System.Windows.Forms.MouseEventArgs)
Handles PictureBox1.MouseDown
PointDepart =
New Point(e.X, e.Y)

End
Sub
<hr />
Private
Sub PictureBox1_MouseMove(
ByVal sender
As
Object,
ByVal e
As System.Windows.Forms.MouseEventArgs)
Handles PictureBox1.MouseMove

If e.Button = Windows.Forms.MouseButtons.Left
Then
'On Calcule la nouvelle coordonnée de l'origine du PictureBox
Dim DeltaX
As
Integer = (PictureBox1.Location.X + e.X - PointDepart.X)

Dim DeltaY
As
Integer = (PictureBox1.Location.Y + e.Y - PointDepart.Y)

'On bloque le déplacement aux limites du pictureBox
If PictureBox1.Width > X_initial
Then
If -DeltaX > (PictureBox1.Width - X_initial)
Then
DeltaX = X_initial - PictureBox1.Width

End
If
If DeltaX > 0
Then
DeltaX = 0

End
If
Else
DeltaX = 0

End
If
If PictureBox1.Height > Y_initial
Then
If -DeltaY > (PictureBox1.Height - Y_initial)
Then
DeltaY = Y_initial - PictureBox1.Height

End
If
If DeltaY > 0
Then
DeltaY = 0

End
If
Else
DeltaY = 0

End
If
PictureBox1.Location =
New Drawing.Point(DeltaX, DeltaY)

End
If
End
Sub
0
Rejoignez-nous