|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Controls in IDE -vs- Running in an AppHello,
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... -- Show quoteHide quoteHope this helps Jay B. Harlow [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "David Miller" <dmiller1***@earthlink.net> wrote in message news:mGFNg.248248$TP1.136158@fe04.news.easynews.com... | 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 Show quoteHide quote > 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... > > "David Miller" <dmiller1***@earthlink.net> wrote in message > news:mGFNg.248248$TP1.136158@fe04.news.easynews.com... > | 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 > | > | That was what I was looking for, thank you.
Show quoteHide quote "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_***@tsbradley.net> wrote in message news:OtxaEzr1GHA.3908@TK2MSFTNGP05.phx.gbl... > 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 > > > "David Miller" <dmiller1***@earthlink.net> wrote in message > news:mGFNg.248248$TP1.136158@fe04.news.easynews.com... > | 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 > | > | > > |
|||||||||||||||||||||||