Solved

Need to progrmatically show a dialog box and close it

Posted on 2008-10-22
8
1,230 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 13

Expert Comment

by:TechTiger007
ID: 22781064
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
ID: 22781091
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
ID: 22781225
Can either of you supply me with some sample code for this, both to create and to close the dialog box?

Thanks.
0
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 
LVL 8

Expert Comment

by:jorgesv13
ID: 22781281
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
 
LVL 13

Accepted Solution

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

Here MessageForm is your form with message
0
 

Author Comment

by:kalittaair
ID: 22782570
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
ID: 22783236
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
ID: 31508946
Thanks!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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