Solved

Need to progrmatically show a dialog box and close it

Posted on 2008-10-22
8
1,218 Views
Last Modified: 2013-11-08
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
Comment
Question by:kalittaair
  • 3
  • 3
  • 2
8 Comments
 
LVL 13

Expert Comment

by:TechTiger007
Comment Utility
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
 
LVL 8

Expert Comment

by:jorgesv13
Comment Utility
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
 

Author Comment

by:kalittaair
Comment Utility
Can either of you supply me with some sample code for this, both to create and to close the dialog box?

Thanks.
0
 
LVL 8

Expert Comment

by:jorgesv13
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 13

Accepted Solution

by:
TechTiger007 earned 250 total points
Comment Utility
Dim form As New MessageForm
form.Show()
form.Close()

Here MessageForm is your form with message
0
 

Author Comment

by:kalittaair
Comment Utility
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
 
LVL 8

Expert Comment

by:jorgesv13
Comment Utility
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
 

Author Closing Comment

by:kalittaair
Comment Utility
Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now