473,796 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1679
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.co m
"Josema" <an*******@disc ussions.microso ft.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.co m
"Josema" <an*******@disc ussions.microso ft.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.ShowDia log () == 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*******@disc ussions.microso ft.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.co m
"Josema" <an*******@disc ussions.microso ft.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
1577
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 button btn2 and I added a openfiledialog in form_test.In btn2 click event handler I used ShowDialog(this) to show openfiledialog. When I ran the program, I found that when the openfiledialog returned, the form_test would close automatically and...
7
2216
by: C# newbie | last post by:
Hello, using openfiledialog, how can I retrieve the path ? thx
4
8009
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 Explorer i am getting error saying that cannot delete that folder as some process is using it. After that i selected a file from the same folder in OpenFileDialog. When i tried to delete the folder after selecting the file also it is giving the...
8
6042
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
6098
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 only the files I want to see appear in the file list box. When I change the filter to one of the other filters, all the files in the list disappear. If I then manually type a filter into the "Filename" textbox, then the files appear and the filter...
1
3011
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 Button1_Click(object sender, EventArgs e) I wrote: OpenFileDialog filedlg = new OpenFileDialog(); filedlg.Title = "Choose an image to upload"; filedlg.InitialDirectory = @"c:\"; filedlg.Filter = "Image Files (JPG, JPEG, GIF, BMP, TIF,
0
1723
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 db I am working with is not the live one the company used...merely a copy on my hard drive. That was easy but I realized that there was no way to change the database should the user decide to do so so I added an openfiledialog so the user could make...
3
2787
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 and select a filename to be opened and then if the Open button is selected we call the OpenFile method.
2
4311
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 dir1/dir2/dir3/dir4/dir5/file.txt
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10455
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.