I have a TextBox named textbox1 and a Button named button1. When I click on button1 I want to browse my file
TextBox
textbox1
Button
button1
var ofd = new Microsoft.Win32.OpenFileDialog() {Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif"}; var result = ofd.ShowDialog(); if (result == false) return; textBox1.Text = ofd.FileName;