Controls in IDE -vs- Running in an App

  • Thread starter Thread starter David Miller
  • Start date Start date
D

David Miller

Hello,

I have a custom control that fails to display because in the IDE it's
looking for some database connections that are not there. The control works
fine in the application because the databases are there. Is there some way
I can stop the control from doing a database lookup if it in the IDE? Or
some way I can figure out the application is running -vs- just being edited
in the IDE?

Thanks,
David
 
David,
Depending on where the database connection is happening, you should be able
to use Component.DesignMode to indicate if the control is currently in
design mode or not.

NOTE: Checking this property in the constructor doesn't work as the control
is in the process of being created & has not yet been sited in a container
in the designer...

--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


| Hello,
|
| I have a custom control that fails to display because in the IDE it's
| looking for some database connections that are not there. The control
works
| fine in the application because the databases are there. Is there some
way
| I can stop the control from doing a database lookup if it in the IDE? Or
| some way I can figure out the application is running -vs- just being
edited
| in the IDE?
|
| Thanks,
| David
|
|
 
Hello Jay B. Harlow [MVP - Outlook],

Also.. you might consider putting the work of the control into a method..
or have it activated by calling a method. That method wont be called in
the IDE.

-Boo
 
Back
Top