473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

OpenFileDialog short question

Hi to all...

When i open a file dialog and the user has selected a
file, the open file dialog remains like thinking a lot
cause a file is too large...
How can i force to close the file dialog?

Thanks
Josema.

Nov 15 '05 #1
3 1658
Josema,

The file dialog doesn't perform any kind of file operations, it just
selects a file. Is it possible that you are performing some sort of
operation before the file dialog closes?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Josema" <an*******@discussions.microsoft.com> wrote in message
news:08****************************@phx.gbl...
Hi to all...

When i open a file dialog and the user has selected a
file, the open file dialog remains like thinking a lot
cause a file is too large...
How can i force to close the file dialog?

Thanks
Josema.

Nov 15 '05 #2
In the event File_Ok of the openfile dialog, i open a word
file and make some operations, this fact makes that the
dialog remains opened for a 30 seconds if the word file
has more than 2 pages aprox...

Josema
-----Original Message-----
Josema,

The file dialog doesn't perform any kind of file operations, it justselects a file. Is it possible that you are performing some sort ofoperation before the file dialog closes?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Josema" <an*******@discussions.microsoft.com> wrote in messagenews:08****************************@phx.gbl...
Hi to all...

When i open a file dialog and the user has selected a
file, the open file dialog remains like thinking a lot
cause a file is too large...
How can i force to close the file dialog?

Thanks
Josema.

.

Nov 15 '05 #3
Why is it in the File OK event?

It's not really good to open anything at the file dialog stage, because as
it's been mentioned, this should be for "selecting files" only.

Are you sure you need to be overriding the file dialog class in the first
place?

Normal procedure is as follows:

OpenFileDialog openDlg = new OpenFileDialog();
if ( openDlg.ShowDialog () == DialogResult.OK )
{
// get your file name here and perform operations to it
}

this way the dialog closes then the operations are performed.

hope that helps.
Dan.

"Josema" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
In the event File_Ok of the openfile dialog, i open a word
file and make some operations, this fact makes that the
dialog remains opened for a 30 seconds if the word file
has more than 2 pages aprox...

Josema
-----Original Message-----
Josema,

The file dialog doesn't perform any kind of file operations, it justselects a file. Is it possible that you are performing some sort ofoperation before the file dialog closes?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Josema" <an*******@discussions.microsoft.com> wrote in messagenews:08****************************@phx.gbl...
Hi to all...

When i open a file dialog and the user has selected a
file, the open file dialog remains like thinking a lot
cause a file is too large...
How can i force to close the file dialog?

Thanks
Josema.

.

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: violin wang | last post by:
hi I wrote a windows based program.The main UI named form_base has a button "btn1".In btn1`s click event handler I used ShowDialog(this) to show another form named form_test.form_test also has a...
7
by: C# newbie | last post by:
Hello, using openfiledialog, how can I retrieve the path ? thx
4
by: Nagachandra Sekhar Grandhi | last post by:
I am facing a problem with OpenFileDialog. It is as follows. I opened OpenFileDialog dialog box and selected a folder in it. After selecting the folder when i tried to delete the same folder in...
8
by: e-mid | last post by:
why does not openFileDialog have closed event? i want to do something; as soon as the dialog closes. is there a way to do this?
8
by: marcus.kwok | last post by:
I am having a weird problem and I have can't figure out why it is happening. I create an OpenFileDialog and set a filename filter. When the dialog first opens, the filter works correctly, and...
1
by: =?Utf-8?B?TW9uaWNh?= | last post by:
Hi 1- I want to pick a file in my website project using asp.net 2- I added System.Windows.Forms by add references to my project. 3- I attach a button to my project. 4- in side...
0
by: Lisa Martin | last post by:
Ok so this is day 2 my first programming job. What I have done is to convert a vb6 program to vb.net... no problem. Today I was asked to "add a db pointer" to one of the forms to make sure that the...
3
by: Tony Johansson | last post by:
Hello! The object called dlgOpenFile is of type OpenFileDialog. In this example the eventhandler OnFileOpen is called when the Open File in a menu is clicked. Here we call the OpenFileDialog...
2
by: Peted | last post by:
Hi i have a circumstance where a user unzips a file, with a certain layer of directories to get to a textfile. So in any directory on the HDD they may end up with something like ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.