Hi,
I'm using wx.NET
And i can't get any MouseMove Event.
I tryed on a StaticBox and a StaticBitmap
What are the components that can catch mousemove events (and also have a picture on them) ?
Thanks
Karim
MouseMove Event
Re: MouseMove Event
Hi!
I remember that I had some problems with that as well.
I'm not sure about wx.NET, but in C++ there is a simple solution for this. All you have to do is create the wxStaticBitmap as normal and then Connect() the event handler to it instead of creating an event table entry.
Like
The event handler itself just works like it would when used in an event table. I'm able to display images and have motion events posted.
Did you derive your class from these and implemented an event table?karim_jouini wrote:And i can't get any MouseMove Event.
I tryed on a StaticBox and a StaticBitmap
I remember that I had some problems with that as well.
Most, if not all, wxWindow derived classes should be able to handle mouse events. The only class with an image on it is wxStaticBitmap.karim_jouini wrote:What are the components that can catch mousemove events (and also have a picture on them) ?
I'm not sure about wx.NET, but in C++ there is a simple solution for this. All you have to do is create the wxStaticBitmap as normal and then Connect() the event handler to it instead of creating an event table entry.
Like
Code: Select all
wxStaticBitmap* st1 = new wxStaticBitmap(this,-1,wxBitmap(img));
st1->Connect( wxID_ANY, wxEVT_MOTION , wxMouseEventHandler(MyFrame::OnMouse),NULL,this );
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4
"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda