[Mono-winforms-list] Possible problem in 2.2 with file dialogs

Paul paul at all-the-johnsons.co.uk
Fri Nov 28 12:42:53 EST 2008


Hi,

I have a very simple OpenFileDialog method which filters filetypes. Only
problem, it's not working. I'm not sure if it's me or mono - I've only
done this once or twice before (I don't normally give people the choice
of the file to load ;-p), so I'm not going to guess the error...

private void BrowseButton_Click(object sender, EventArgs e)
{
	OpenFileDialog fdlg = new OpenFileDialog();
	fdlg.Title = "Open File Dialog";
	fdlg.InitialDirectory = @"C:\ ";
	fdlg.Filter = "Text files (*.txt)|.txt|All files (*.*)|*.*";
	fdlg.FilterIndex = 1;
	fdlg.RestoreDirectory = true;
	if (fdlg.ShowDialog() == DialogResult.OK)
	{
		textBox1.Text = fdlg.FileName;
	}
}

Show all files works, but .txt doesn't.

Is this me or mono?

TTFN

Paul
-- 
Sie können mich aufreizen und wirklich heiß machen!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20081128/ef3dcf42/attachment.bin 


More information about the Mono-winforms-list mailing list