Detecting when a child form is being moved
-
I was wondering if somebody can point me in the right direction on this - The goal is to detect when a child form is being moved and read out the current position while moving -I could use a timer to read out the current position - but at this point I have not been able to fire an event that indicates the form being moved or not ( grabbed by the tool bar that is) This is just a normal form with standard close minimize / maximize buttons (Not that that should make a difference I assume) What am I missing ? Any ideas ? Georg
-
I was wondering if somebody can point me in the right direction on this - The goal is to detect when a child form is being moved and read out the current position while moving -I could use a timer to read out the current position - but at this point I have not been able to fire an event that indicates the form being moved or not ( grabbed by the tool bar that is) This is just a normal form with standard close minimize / maximize buttons (Not that that should make a difference I assume) What am I missing ? Any ideas ? Georg
You're missing the Form.Move event. All you have to do is handle that event in your form code and you can get the Top and Left property values for the position of the form.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
You're missing the Form.Move event. All you have to do is handle that event in your form code and you can get the Top and Left property values for the position of the form.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave KreskowiakThat's what I thought - unfortunately that event does not fire for me.... Is there a setting in the parent that could prevent that event from firing ? Georg
-
That's what I thought - unfortunately that event does not fire for me.... Is there a setting in the parent that could prevent that event from firing ? Georg
That means there is no code "wiring-up" the event handler. If you're looking at the position of Form2 from inside Form1 code, you have to "wire up" the event yourself. If you're only looking at the position of Form2 inside Form2 code, the event isn't getting wired up in the Designer code. Which is it?
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak