Create a windows panel that is invisible that still accepts click message
I'm using c++/cli with visual studio 2010 express edition.
What I want to do is create a panel that is invisible but that still accepts/receives the click and double click messages and possibly other mouse input. If I set the controls visibility to FALSE then this seems to disable any mouse input.
I have tried getting the paint message and doing nothing (as was suggested by other sources) to try and make the panel simply not draw but not be invisible however the panel still seems to be drawing.
What should I b开发者_StackOverflowe doing in the paint message to tell windows that I have draw the panel?
My panel drawing function is:
private: System::Void panel1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
}
If there are any other suggestions about how I could achieve this then that would be helpful.
In the end I scrapped this idea all together, the problem was to get a way of getting the mouse input from a window that had been "parentented" by a NativeWindow class. This meant that the window I was expecting to receive messages (the child window) was not receiving the messages.
In order to get the messages you need to override the event handler in your parent NativeWindow class. Here you can handle the event This is where I got the solution:
http://msdn.microsoft.com/en-us/library/system.windows.forms.nativewindow.createhandle.aspx
精彩评论