|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
OpenFileDialog and ApplicationSettings (FileName)In a very simple application I found that if I setup ApplicationSettings to
remember FileName, InitialDirectory, FileFilter and FileFilterIndex, InitialDirectory seemed to be the only thing which was remembered across invocations. I just coded the most simple program I could imagine and setup the OpenFileDialog ApplicationSettings to remember only FileName and InitialDirectory. Again InitialDirectory is remembered across invocations of the program but FileName is not. My searches have not found anyone else reporting this problem. I am using NET 3.5 on a Vista x64 system. Thanks for any comments or insights. Bob High,
Maybe a stupid question, but why do you want to use an openFileDialog when you know the filename? Cor Show quoteHide quote "eBob.com" <eBob.***@totallybogus.com> wrote in message news:eN7TMcE$JHA.4432@TK2MSFTNGP05.phx.gbl... > In a very simple application I found that if I setup ApplicationSettings > to remember FileName, InitialDirectory, FileFilter and FileFilterIndex, > InitialDirectory seemed to be the only thing which was remembered across > invocations. > > I just coded the most simple program I could imagine and setup the > OpenFileDialog ApplicationSettings to remember only FileName and > InitialDirectory. Again InitialDirectory is remembered across invocations > of the program but FileName is not. > > My searches have not found anyone else reporting this problem. I am using > NET 3.5 on a Vista x64 system. > > Thanks for any comments or insights. Bob Uh? Just because the filename variable has a current value does not mean
that the user is going to choose to open that file. The user might select a different file. That's what the Open File dialog is for. It allows the user to select the default filename as the file to open, or to choose a different one. Show quoteHide quote "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message news:OgYyaOH$JHA.1376@TK2MSFTNGP02.phx.gbl... > High, > > Maybe a stupid question, but why do you want to use an openFileDialog when > you know the filename? > > Cor > > "eBob.com" <eBob.***@totallybogus.com> wrote in message > news:eN7TMcE$JHA.4432@TK2MSFTNGP05.phx.gbl... >> In a very simple application I found that if I setup ApplicationSettings >> to remember FileName, InitialDirectory, FileFilter and FileFilterIndex, >> InitialDirectory seemed to be the only thing which was remembered across >> invocations. >> >> I just coded the most simple program I could imagine and setup the >> OpenFileDialog ApplicationSettings to remember only FileName and >> InitialDirectory. Again InitialDirectory is remembered across >> invocations of the program but FileName is not. >> >> My searches have not found anyone else reporting this problem. I am >> using NET 3.5 on a Vista x64 system. >> >> Thanks for any comments or insights. Bob > Thanks,
Bob Show quoteHide quote "James Hahn" <jh***@yahoo.com> wrote in message news:eIySjlI$JHA.200@TK2MSFTNGP05.phx.gbl... > Uh? Just because the filename variable has a current value does not mean > that the user is going to choose to open that file. The user might select > a different file. That's what the Open File dialog is for. It allows the > user to select the default filename as the file to open, or to choose a > different one. > > "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> wrote in message > news:OgYyaOH$JHA.1376@TK2MSFTNGP02.phx.gbl... >> High, >> >> Maybe a stupid question, but why do you want to use an openFileDialog >> when you know the filename? >> >> Cor >> >> "eBob.com" <eBob.***@totallybogus.com> wrote in message >> news:eN7TMcE$JHA.4432@TK2MSFTNGP05.phx.gbl... >>> In a very simple application I found that if I setup ApplicationSettings >>> to remember FileName, InitialDirectory, FileFilter and FileFilterIndex, >>> InitialDirectory seemed to be the only thing which was remembered across >>> invocations. >>> >>> I just coded the most simple program I could imagine and setup the >>> OpenFileDialog ApplicationSettings to remember only FileName and >>> InitialDirectory. Again InitialDirectory is remembered across >>> invocations of the program but FileName is not. >>> >>> My searches have not found anyone else reporting this problem. I am >>> using NET 3.5 on a Vista x64 system. >>> >>> Thanks for any comments or insights. Bob >> > Did you save the settings (the MS documentation varies re whether or not you
need to explicitly save them). Show quoteHide quote "eBob.com" <eBob.***@totallybogus.com> wrote in message news:eN7TMcE$JHA.4432@TK2MSFTNGP05.phx.gbl... > In a very simple application I found that if I setup ApplicationSettings > to remember FileName, InitialDirectory, FileFilter and FileFilterIndex, > InitialDirectory seemed to be the only thing which was remembered across > invocations. > > I just coded the most simple program I could imagine and setup the > OpenFileDialog ApplicationSettings to remember only FileName and > InitialDirectory. Again InitialDirectory is remembered across invocations > of the program but FileName is not. > > My searches have not found anyone else reporting this problem. I am using > NET 3.5 on a Vista x64 system. > > Thanks for any comments or insights. Bob Hi James,
Thanks for your interest. No, I do nothing explicitly to save the settings. In my (limited) experience with application settings that is not necessary. In this particular case the directory is saved and restored by something, the framework I suppose, but for some reason the filename is not. Thanks, Bob Show quoteHide quote "James Hahn" <jh***@yahoo.com> wrote in message news:uc687hI$JHA.5092@TK2MSFTNGP03.phx.gbl... > Did you save the settings (the MS documentation varies re whether or not > you need to explicitly save them). > > "eBob.com" <eBob.***@totallybogus.com> wrote in message > news:eN7TMcE$JHA.4432@TK2MSFTNGP05.phx.gbl... >> In a very simple application I found that if I setup ApplicationSettings >> to remember FileName, InitialDirectory, FileFilter and FileFilterIndex, >> InitialDirectory seemed to be the only thing which was remembered across >> invocations. >> >> I just coded the most simple program I could imagine and setup the >> OpenFileDialog ApplicationSettings to remember only FileName and >> InitialDirectory. Again InitialDirectory is remembered across >> invocations of the program but FileName is not. >> >> My searches have not found anyone else reporting this problem. I am >> using NET 3.5 on a Vista x64 system. >> >> Thanks for any comments or insights. Bob > I would recommend saving the settings in the form closing event, if only to
see if it makes any difference. Are you binding the properties or setting them manually? If you set the default values of those properties to something other than null in the settings designer, then synchronise, you should be able to see the defaults in the dialog object by the end of the form load event. That would at least confirm that the load is operating OK. Then you can check the settings values in the form closing, just before you save. It is also possible to trace the settings update through the My class code, to detect when they are getting updated. Show quoteHide quote "eBob.com" <faken***@totallybogus.com> wrote in message news:uMjAn$K$JHA.4168@TK2MSFTNGP05.phx.gbl... > Hi James, > > Thanks for your interest. > > No, I do nothing explicitly to save the settings. In my (limited) > experience with application settings that is not necessary. In this > particular case the directory is saved and restored by something, the > framework I suppose, but for some reason the filename is not. > > Thanks, Bob > > "James Hahn" <jh***@yahoo.com> wrote in message > news:uc687hI$JHA.5092@TK2MSFTNGP03.phx.gbl... >> Did you save the settings (the MS documentation varies re whether or not >> you need to explicitly save them). >> >> "eBob.com" <eBob.***@totallybogus.com> wrote in message >> news:eN7TMcE$JHA.4432@TK2MSFTNGP05.phx.gbl... >>> In a very simple application I found that if I setup ApplicationSettings >>> to remember FileName, InitialDirectory, FileFilter and FileFilterIndex, >>> InitialDirectory seemed to be the only thing which was remembered across >>> invocations. >>> >>> I just coded the most simple program I could imagine and setup the >>> OpenFileDialog ApplicationSettings to remember only FileName and >>> InitialDirectory. Again InitialDirectory is remembered across >>> invocations of the program but FileName is not. >>> >>> My searches have not found anyone else reporting this problem. I am >>> using NET 3.5 on a Vista x64 system. >>> >>> Thanks for any comments or insights. Bob >> > >
Other interesting topics
structures in VB.Net
vb.net and Ms SQL Connection ? Using "Me" DataGridView Event Add Line Break to mail body Serializing Custom Generic Collection (Of InterfaceType) Inherited form: prevent the Load-event from firing for inheritors Detect Default namespace (Unkown) Problem with System.Drawing.Bitmap() Suggestion for Modbus control? |
|||||||||||||||||||||||