By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,544 Members | 2,065 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,544 IT Pros & Developers. It's quick & easy.

transmit mouse events to the parent form / Control.Move Event - Bug?

P: 1
Hi all

I have two problems:

Problem #1:

I'm using a .NET Form with the property 'FormBorderStyle' set to 'None'. The idea is to completely cover the area of that Form with a UserControl. In order to be able to move that Form around with the mouse I have to implement EventHandlers for the MouseDown, MouseUp and MouseMove event.
Now the problem I have is these Events will never be fired because the entire dialog is covered by the UserControl. First I thought I could simply transmit the Events fired by the UserControl to the Form but the problem is: The UserControl itself consists of other controls that completely cover the area of the UserControl. Is there no other way than to write EventHandlers for these three (MouseDown, MouseUp, MouseMove) Events for every control of the UserControl and then again write EventHandlers for these Events in the Form? Or is there a property or something that automatically transmits these Events to the parent Form?

Problem #2:

This Form shall always be displayed in the center of a second (Application / Main Form) Form. For this I attach an EventHandler to the Resize Event of the Main Form. This works fine, the position of my Form is always adapted if the Main Form is resized. The Problem starts when I move the Main Form with the mouse. My Form does not ALWAYS move to the correct location although I have an EventHandler that listens to the Form.Move Event. I realized that the Move Event does not get fired correctly, sometimes it is fired and sometimes it is not. Is this a know problem / .Net Framework bug or do I misunderstand something?

Thanks for the help and regards

Sep 4 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.