I have created a windows forms in which on certain button click i show FolderBrowserDialog. After the user selects a folder and click on Ok button of FolderBrowserDialog i have done some work in the Ok click part of FolderBrowserDialog.
For example

if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
{
   generateFiles();
}

The Problem is: folderBrowserDialog doesent disappear completely untill generateFiles(); method has completely done it's job.

This behaviour has made my form look bad, because while generateFiles() method is working i have used progressbar to indicate the progress of generateFiles(); method.

How can i make FolderBrowserDialog disappear completely so that my progressbar looks good.

Please help.
Thanks

Recommended Answers

All 2 Replies

Try calling Application.DoEvents() before calling generateFiles
---------
- G Himangi, LogicNP Software http://www.ssware.com
Shell MegaPack: Drop-In GUI Controls For Windows Explorer Like File And
Folder Browser Functionality
CryptoLicensing: Add licensing, copy-protection and activation to your
software
EZNamespaceExtensions: Fast and painless development of namespace extensions
EZShellExtensions: Rapid development of all shell extensions,explorer bars
and BHOs


I have created a windows forms in which on certain button click i show FolderBrowserDialog. After the user selects a folder and click on Ok button of FolderBrowserDialog i have done some work in the Ok click part of FolderBrowserDialog.
For example

if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
{
   generateFiles();
}

The Problem is: folderBrowserDialog doesent disappear completely untill generateFiles(); method has completely done it's job.

This behaviour has made my form look bad, because while generateFiles() method is working i have used progressbar to indicate the progress of generateFiles(); method.

How can i make FolderBrowserDialog disappear completely so that my progressbar looks good.

Please help.
Thanks

Thanks,
That solved my problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.