Controls in IDE -vs- Running in an App

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
 
J

Jay B. Harlow [MVP - Outlook]

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
|
|
 
G

GhostInAK

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top