Koray Samsun

Hi, i want to add an open file dialog control to my program. But want it to be seen always, not close after DialogResult. Is this possible

Re: Windows Forms General Embedding Open File dialog

Karthik Krishnaswami

If you are using FrameWork 2.0,

it should be possible

this.openFileDialog1.FileOk += new CancelEventHandler(openFileDialog1_FileOk);

void openFileDialog1_FileOk(object sender, CancelEventArgs e)

{

string name = this.openFileDialog1.FileName;

e.Cancel = true;

}

e.Cancel = true will not allow the dialog to be dismissed.





Re: Windows Forms General Embedding Open File dialog

nobugz

Not without jumping through some creepy hoops. OpenFileDialog.ShowDialog() disables your other forms. You could possibly avoid that by calling ShowDialog() in another thread. Be careful with the usual synchronization issues...