Hello:
How do I show a MessageBox with out having the "OK". Reason is I want to display "Connecting To Server, Please Wait...", while the server connection is being attempted, then when its done, have it close.
If I have a good connection its immediate, but if the connection string is bad it waiting like 10-20 seconds. I don't want it sitting there without informing the user.
All i can think of is to display a little form with the message and then close it when the connection attempt is done. Is this the only way?
Loading

theLizardRank #1,079 · 1.8K reputationPosted Mar 25, 2010, 9:33 PM EDT
To do whatyou want, create a form without border put your message on a label and show modal in a separate thread at the point where you call the form showing your message have a while loop testing the form is visible or something while it is do not allow any other processing, in your thread, close the form only when you have a connection or it has timed out.
you need to research this.
VasanthRank #1,487 · 1.1K reputationPosted Mar 25, 2010, 9:20 PM EDT
GustavoRank #1,990 · 732 reputationPosted Mar 25, 2010, 9:26 PM EDT
GustavoRank #1,990 · 732 reputationPosted Mar 25, 2010, 9:37 PM EDT
OK, I will play with it. Thanks.
BTW: My login form was 837 lines of code. I cleaned it up and used your routines, now its 240 lines. It can be less but I line to make my DBCommand multiple lines so its easier to read. Thank you so much.
Reason about the bad connection string... I did it on purpose to be sure it would handle it. It does take 5-20 seconds.
theLizardRank #1,079 · 1.8K reputationPosted Mar 25, 2010, 10:18 PM EDT