Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1237
  • Last Modified:

Need to progrmatically show a dialog box and close it

Using VS 2008, .NET 3.5, C#, Windows form

I have an app that queries AD (LDAP) on startup. This takes approx 8 seconds. I'd like to pop up a dialog box saying something like "System is loading...please wait." prior to the LDAP call - no buttons or return values on the dialog box. Then, once the AD has been queried and loaded into my program I need to progrmatically close the dialog box. The MessageBox control does not seem to allow me to close it within my code and I have not found an easy way to do this. Any ideas Experts?

Thanks.
0
kalittaair
Asked:
kalittaair
  • 3
  • 3
  • 2
1 Solution
 
TechTiger007Commented:
create a form with your message on it.
From the code create an object of this form and display.  Once the data is loaded you can close the form from the code
0
 
jorgesv13Commented:
You can also create a Form with your message, and set it as "Splash Screen", in the Project Properties.
This way, the Splash Form will be displayed while your main Form is loading and querying the AD
0
 
kalittaairAuthor Commented:
Can either of you supply me with some sample code for this, both to create and to close the dialog box?

Thanks.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jorgesv13Commented:
For setting a Form as SplashScreen, you have to:
- Create (design) a Form with your custom message
- Right-click on the Project, and choose "Properties"
- In the Application TAB, the last Option is "Splash Screen", there you can select your previously created Form

No additional code is needed for this.
0
 
TechTiger007Commented:
Dim form As New MessageForm
form.Show()
form.Close()

Here MessageForm is your form with message
0
 
kalittaairAuthor Commented:
jorgesv13 - Please confirm your instructions. Using VS 2008, right-click on the project, chose properties, I see nothing about a "splash screen" under the Application tab. I do see "Startup Object" but my only choice under there is ProjectName.Program.

0
 
jorgesv13Commented:
Sorry, I thought it should be the same as in VS2005.
I'm attaching an image of the Application tab, where I normally set the Splash Screen Form.
vs2005.JPG
0
 
kalittaairAuthor Commented:
Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now