Click here to Skip to main content
15,909,498 members
Home / Discussions / C#
   

C#

 
QuestionSetting things like TCP/IP Address and Gateway through code. Pin
jbradshaw5-Jul-07 8:13
jbradshaw5-Jul-07 8:13 
AnswerRe: Setting things like TCP/IP Address and Gateway through code. Pin
Bert delaVega5-Jul-07 10:40
Bert delaVega5-Jul-07 10:40 
GeneralRe: Setting things like TCP/IP Address and Gateway through code. Pin
jbradshaw6-Jul-07 4:30
jbradshaw6-Jul-07 4:30 
QuestionTitle of FolderBrowserDialog [modified] Pin
topksharma19825-Jul-07 7:49
topksharma19825-Jul-07 7:49 
AnswerRe: Title of FolderBrowserDialog Pin
led mike5-Jul-07 8:08
led mike5-Jul-07 8:08 
AnswerRe: Title of FolderBrowserDialog Pin
Luc Pattyn5-Jul-07 8:44
sitebuilderLuc Pattyn5-Jul-07 8:44 
AnswerRe: Title of FolderBrowserDialog Pin
Nouman Bhatti5-Jul-07 20:14
Nouman Bhatti5-Jul-07 20:14 
QuestionDefault Dialog Directories Pin
PhilDanger5-Jul-07 6:36
PhilDanger5-Jul-07 6:36 
Hey everyone,

This may be a very simple (hopefully it is) question and answer, but I'm having trouble figuring this one out.

I want a SaveFileDialog and an OpenFileDialog to start in a chosen directory. Seems simple enough, I'll just create the directory in case it doesn't exist, and then set the InitialDirectory property of the dialog -- but for some reason it's still opening in the last directory that I had browsed to in a previous dialog.

Here's the code:

private const string ATF_FILTER = "AOI Template Files (*.atf)|*.atf";

private const string C_SAVE_DIRECTORY = @"./Saved Templates";

//Save Template
private void Save_Click(object sender, EventArgs e)
{
    Directory.CreateDirectory(C_SAVE_DIRECTORY);
    SaveFileDialog diag = new SaveFileDialog();
    diag.InitialDirectory = C_SAVE_DIRECTORY;
    diag.DefaultExt = ".atf";
    diag.Filter = ATF_FILTER;
    if (diag.ShowDialog() == DialogResult.OK)
    {
        DrawBox.SaveTemplate(diag.FileName);
    }
}


Any idea what could be going wrong?

Thanks,

Phil
AnswerRe: Default Dialog Directories Pin
led mike5-Jul-07 6:42
led mike5-Jul-07 6:42 
AnswerRe: Default Dialog Directories Pin
PhilDanger5-Jul-07 6:58
PhilDanger5-Jul-07 6:58 
GeneralRe: Default Dialog Directories Pin
led mike5-Jul-07 7:23
led mike5-Jul-07 7:23 
AnswerRe: Default Dialog Directories Pin
Luc Pattyn5-Jul-07 6:45
sitebuilderLuc Pattyn5-Jul-07 6:45 
QuestionApplication will download with XP but not Vista Pin
bvdahl5-Jul-07 6:28
bvdahl5-Jul-07 6:28 
Questionurgant: crystal report problem Pin
rmedo5-Jul-07 6:09
rmedo5-Jul-07 6:09 
AnswerBad user! Pin
leckey5-Jul-07 10:13
leckey5-Jul-07 10:13 
GeneralRe: Bad user! Pin
Paul Conrad5-Jul-07 14:36
professionalPaul Conrad5-Jul-07 14:36 
AnswerRe: urgant: crystal report problem Pin
Nouman Bhatti5-Jul-07 20:21
Nouman Bhatti5-Jul-07 20:21 
GeneralRe: urgant: crystal report problem Pin
rmedo5-Jul-07 23:27
rmedo5-Jul-07 23:27 
AnswerRe: urgant: crystal report problem Pin
Nouman Bhatti5-Jul-07 20:22
Nouman Bhatti5-Jul-07 20:22 
GeneralRe: urgant: crystal report problem Pin
rmedo5-Jul-07 23:27
rmedo5-Jul-07 23:27 
QuestionInclude IIS in Windows Service Pin
Roland Bär5-Jul-07 6:02
Roland Bär5-Jul-07 6:02 
AnswerRe: Include IIS in Windows Service Pin
led mike5-Jul-07 6:39
led mike5-Jul-07 6:39 
GeneralRe: Include IIS in Windows Service Pin
Roland Bär5-Jul-07 7:15
Roland Bär5-Jul-07 7:15 
GeneralRe: Include IIS in Windows Service Pin
led mike5-Jul-07 7:44
led mike5-Jul-07 7:44 
QuestionComboBox Data Binding Pin
goldoche5-Jul-07 5:47
goldoche5-Jul-07 5:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.