How can I check inside the control where I am - in design mode or run-time mode?
-
Hello, I have a simple questions: How can I check inside the control where I am - in design mode or run-time mode? Thank you in advance. Goran
-
Well if you want to know what the parent of the control is just use the
Parent
property of the control. If you want to know where the mouse is, use theMousePosition
property of the control.Actually, I would like to check in the constructor of my control where I am - in designer or in runtime. How can i do that?
-
Actually, I would like to check in the constructor of my control where I am - in designer or in runtime. How can i do that?
-
Are you sure?
-
Actually, that's not true. When you drop an instance of your control on a form, the code IS executed. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Actually, I would like to check in the constructor of my control where I am - in designer or in runtime. How can i do that?
If your talking about your controls position on the form, AFAIK, you can't do that in the constructor. I don't think your control has it's
Location
property set until after the constructor returns. I could be wrong though... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -
Hello, I have a simple questions: How can I check inside the control where I am - in design mode or run-time mode? Thank you in advance. Goran