Skip to content

Instantly share code, notes, and snippets.

@osya
Last active November 26, 2015 07:23
Show Gist options
  • Save osya/4cbb66b49760fbe8bbf8 to your computer and use it in GitHub Desktop.
Save osya/4cbb66b49760fbe8bbf8 to your computer and use it in GitHub Desktop.
WinForms File Open Dialog #CSharp
public void butSelectFile_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "Текстовые файлы|*.txt|Все файлы|*.*";
if (dlg.ShowDialog() == DialogResult.OK)
{
fldFilePath.Text = dlg.FileName;
if (FileOpenClick != null) FileOpenClick(this, EventArgs.Empty);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment