473,322 Members | 1,806 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,322 software developers and data experts.

OpenFileDialog Again

I've got an OFD attached to a form. It works OK when it first opens, but if
I change the file filter, the dialog does not refresh, i.e., the display is
just blank. If I press the Open button, then the control repaints. The same
code runs fine in VB. Does any one know what's going on?

Ken
Nov 17 '05 #1
5 1628
Hi,

Try assigning a value to the FilterIndex property after changing the filter:

http://msdn.microsoft.com/library/de...IndexTopic.asp

Regards - Octavio

"Ken Kast" <ke*@NOSPAMkenkast.com> escribió en el mensaje
news:eK**************@TK2MSFTNGP12.phx.gbl...
I've got an OFD attached to a form. It works OK when it first opens, but
if I change the file filter, the dialog does not refresh, i.e., the
display is just blank. If I press the Open button, then the control
repaints. The same code runs fine in VB. Does any one know what's going
on?

Ken

Nov 17 '05 #2
When I said "change the file filter" I meant in the dropdown list at the
bottom of the dialog. This is all happening after ofd.ShowDialog is called.
I'm thinking a Repaint event is not being raised or handled until I press
the Open button, but even so, I have no way of making it happen.

Ken

"Octavio Hernandez" <do****@danysoft.com> wrote in message
news:OD**************@TK2MSFTNGP09.phx.gbl...
Hi,

Try assigning a value to the FilterIndex property after changing the
filter:
http://msdn.microsoft.com/library/de...IndexTopic.asp

Regards - Octavio

"Ken Kast" <ke*@NOSPAMkenkast.com> escribió en el mensaje
news:eK**************@TK2MSFTNGP12.phx.gbl...
I've got an OFD attached to a form. It works OK when it first opens, but
if I change the file filter, the dialog does not refresh, i.e., the
display is just blank. If I press the Open button, then the control
repaints. The same code runs fine in VB. Does any one know what's going
on?

Ken


Nov 17 '05 #3
After you update the filter refresh the form.

"Ken Kast" wrote:
When I said "change the file filter" I meant in the dropdown list at the
bottom of the dialog. This is all happening after ofd.ShowDialog is called.
I'm thinking a Repaint event is not being raised or handled until I press
the Open button, but even so, I have no way of making it happen.

Ken

"Octavio Hernandez" <do****@danysoft.com> wrote in message
news:OD**************@TK2MSFTNGP09.phx.gbl...
Hi,

Try assigning a value to the FilterIndex property after changing the
filter:
http://msdn.microsoft.com/library/de...IndexTopic.asp

Regards - Octavio

"Ken Kast" <ke*@NOSPAMkenkast.com> escribió en el mensaje
news:eK**************@TK2MSFTNGP12.phx.gbl...
I've got an OFD attached to a form. It works OK when it first opens, but
if I change the file filter, the dialog does not refresh, i.e., the
display is just blank. If I press the Open button, then the control
repaints. The same code runs fine in VB. Does any one know what's going
on?

Ken



Nov 17 '05 #4
Actually thats wrong. I think you will have to close and open the dialog for
it to refresh.

"carion1" wrote:
After you update the filter refresh the form.

"Ken Kast" wrote:
When I said "change the file filter" I meant in the dropdown list at the
bottom of the dialog. This is all happening after ofd.ShowDialog is called.
I'm thinking a Repaint event is not being raised or handled until I press
the Open button, but even so, I have no way of making it happen.

Ken

"Octavio Hernandez" <do****@danysoft.com> wrote in message
news:OD**************@TK2MSFTNGP09.phx.gbl...
Hi,

Try assigning a value to the FilterIndex property after changing the
filter:
http://msdn.microsoft.com/library/de...IndexTopic.asp

Regards - Octavio

"Ken Kast" <ke*@NOSPAMkenkast.com> escribió en el mensaje
news:eK**************@TK2MSFTNGP12.phx.gbl...
> I've got an OFD attached to a form. It works OK when it first opens, but
> if I change the file filter, the dialog does not refresh, i.e., the
> display is just blank. If I press the Open button, then the control
> repaints. The same code runs fine in VB. Does any one know what's going
> on?
>
> Ken
>


Nov 17 '05 #5
OK, I've figured out when it happens, but don't know why. In my actual
project I have a Main class which is the startup object. It creates the
main form and shows it. In that case I get the funny behavior. I built a
test project. In it the main form is the startup object, and everything
works fine.

Ken

"carion1" <ca*****@discussions.microsoft.com> wrote in message
news:4D**********************************@microsof t.com...
Actually thats wrong. I think you will have to close and open the dialog
for
it to refresh.

"carion1" wrote:
After you update the filter refresh the form.

"Ken Kast" wrote:
> When I said "change the file filter" I meant in the dropdown list at
> the
> bottom of the dialog. This is all happening after ofd.ShowDialog is
> called.
> I'm thinking a Repaint event is not being raised or handled until I
> press
> the Open button, but even so, I have no way of making it happen.
>
> Ken
>
> "Octavio Hernandez" <do****@danysoft.com> wrote in message
> news:OD**************@TK2MSFTNGP09.phx.gbl...
> > Hi,
> >
> > Try assigning a value to the FilterIndex property after changing the
> > filter:
> >
> >
> > http://msdn.microsoft.com/library/de...IndexTopic.asp
> >
> > Regards - Octavio
> >
> > "Ken Kast" <ke*@NOSPAMkenkast.com> escribió en el mensaje
> > news:eK**************@TK2MSFTNGP12.phx.gbl...
> >> I've got an OFD attached to a form. It works OK when it first opens,
> >> but
> >> if I change the file filter, the dialog does not refresh, i.e., the
> >> display is just blank. If I press the Open button, then the control
> >> repaints. The same code runs fine in VB. Does any one know what's
> >> going
> >> on?
> >>
> >> Ken
> >>
> >
> >
>
>
>

Nov 17 '05 #6

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

Similar topics

0
by: andrija | last post by:
When calling OpenFileDialog, in one project I get exception out of memory (untrappable), while in another it works ok. (I create a new project with just this code and it sometimes does not work,...
3
by: Ed P. | last post by:
Hello, I have an application that uses an access database that is stored in my computer. I would like to set up a OpenFileDialog object to be able to select the source of this database (i.e....
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...
4
by: hullnwm | last post by:
In my asp.net page I'm attempting to use the OpenfileDialog object to offer a common dialog box for the user to select a particular file on their hard drive that may subsequently be uploaded to...
4
by: Chuck Edgeworth | last post by:
I'm trying to be able to select a combination of files and folders. When I try to use the OpenFileDialog it will allow me to select them but when I press the Open button it only informs me of the...
6
by: barbara_dave | last post by:
Hi, All, I want to use the openfiledialog to open different extension files in different directory( only one type files at one time). I set the OpenFiledialog InitialDirectory and Filter...
4
by: bbembi_de | last post by:
Hello everyone, I have a C# program that runs a batch from the command line. I use the following code for that: String arguments = "/C CALL batchfile.bat"; ProcessStartInfo startInfo = new...
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...
3
by: Martijn Mulder | last post by:
It strikes me that System.Windows.Forms.OpenFileDialog seems te 'remember' which directory it was in last, even when a new OpenFileDialog-object is created for every access to the file system....
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.