468,720 Members | 1,803 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,720 developers. It's quick & easy.

Control in Runtime vs Designtime

I would like to be able to tell whether my component code is executed when I
instanciate a control in runtime or in designtime.

Can anybody give me a clua as to how you can do that?

Cheers,
Johnny J.
Aug 14 '07 #1
2 1559
use the DesignMode - Property

Control ctrl = new Control();
if (ctrl.DesignMode)
{
//is in designMode
}
Aug 14 '07 #2
Thanks both of you - It was much simpler than I had expected... ;-)

/Johnny J.

"Johnny Jörgensen" <jo**@altcom.sewrote in message
news:Oe**************@TK2MSFTNGP06.phx.gbl...
>I would like to be able to tell whether my component code is executed when
I instanciate a control in runtime or in designtime.

Can anybody give me a clua as to how you can do that?

Cheers,
Johnny J.

Aug 14 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Weinand Daniel | last post: by
1 post views Thread by Green | last post: by
10 posts views Thread by Yuk Tang | last post: by
7 posts views Thread by Varangian | last post: by
2 posts views Thread by rotsj | last post: by
2 posts views Thread by Johnny Jörgensen | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Oskars | last post: by
9 posts views Thread by bryonone | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.