Designtime conditional

  • Thread starter Thread starter Sagaert Johan
  • Start date Start date
S

Sagaert Johan

Hi
in my solution to the PPC2003 & toolbar icon issue i would like to have that
a line is not interpreted bu the forms designer.

in the InitializeComponent() i would like it to work like this.

Is there a define or an attribute to get it working like this ?


#if DESIGNTIME
this.toolBar1.ImageList = this.imageList1;
#endif


Johan
 
The control has a boolean property, DesignMode, that is true if the object
is hosted in the designer.

Be careful though because this property is NOT valid in the constructor.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Create a new configuration called Design - and add a Conditional Compilation
Constant called DESIGNTIME.
Use this configuration whenever you are working with the designers and use
the standard Debug & Release configutaions to actually compile.

I use this technique to morph 'UserControls' back and forth between Form (
for designer ) & Control ( for compilation )

Gerry
 
Back
Top