carson myers -5 Unverified User

I can't find out if a form is in focus in my code.
I have a form subclassed to catch an event that the form is being moved, so that I can have a separate form docked to it that moves along with it (without using a timer). But each form has this code in it and when one form moves the other moves as well, causing both FormMove events to fire simultaneously making the movement rough and ugly. I want to use an if statement to check if the form is in focus before running this code but I can't figure it out. I tried making a boolean variable that is set to true when the GotFocus event fires, and set to false when the LostFocus event fires. But it is always false.

Any suggestions?