Mouse coordinates in a PictureBox window

S

saya

Hello,

In a WinCE WinForm application, a PictureBox is used as an
imageholder, covering a section of the WinForm.

The app needs to provide the X,Y coordinate values of that
particular PictureBox. Unfortunately MouseEv.X and MouseEv.Y
stops functioning at the boundaries of the PictureBox,
leaving a 'hole', the size of the PictureBox, for the X,Y
information.

Questions are:
1. How do I detect the PictureBox? There is very little
events in WinCE: only Validation and ParentChanged.
'Hovering' detection is not supported ... .

2. How to acquire the local/relative PictureBox coordinates?

TIA.
Saya
 
S

saya

Chris, thanks for responding.
Eventually, yes, I do want the MouseDown event in the picbox. For the
moment I'm struggling on how to detect that my mouse (or 'cursor' as
they call it in the CF world) is entering the picbox. Like the simple
OnMouseHover, available for the desktop Framework version. Then, I
need to remap the picbox local coordinates: top left screen as 0,0
etc.
These are my challenges .... .
FYI, I did follow the given opennetcf link, but it's to
difficult.vague for me as a CF-beginner. Do you have more explicit
tips?
Thank you.

Saya
 
D

Daniel Moth

All events in dotnet are ultimately sourced by some windows message sent to
the handle of the control (.net controls wrap all that for us).

The netcf does not offer all events so in some cases you need to hook into
the WM sent to the handle. As Chris pointed out, you can use IMessageFilter:
http://vault.netcf.tv/VaultService/...essageFilter.cs&version=1&includedversions=20
(guest, guest)

So either borrow the code (and its dependents) or use the SDF binaries from
opennetcf...

Searching the archives will also point to similar usages:
http://groups-beta.google.com/group...sageFilter&qt_g=1&searchnow=Search+this+group

Cheers
Daniel
 
S

saya

Daniel, great.
Thanks for the explanations. I'm studying your stuff now .... .

Dnloaded the SDF binaries (install it) + sources (tried to open it in
VS7 ... got an error: 'Some of the properties associated with the
solution could not be read'. Must be me doing something wrongly.)
Anyway, the dnloadable example app 'ApplicationExCSharp' is of great
help, for a SDF-novice, in explaining how the SDF works.

Regards, Saya
=======================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top