private void btnImageViewer_Click(object sender, EventArgs e) { using (OpenFileDialog ofd = new OpenFileDialog()) { string sPath = CmbBx_ImageViewer.SelectedIndex == -1 ? CmbBx_ImageViewer.Text : Environment.CurrentDirectory; ofd.Filter = "Executables (*.exe)|*.exe"; ofd.InitialDirectory = sPath; if (ofd.ShowDialog() == DialogResult.OK) { CmbBx_ImageViewer.Text = ofd.FileName; SettingsChanged(stCurrent.DefaultProgramChanged(ofd.FileName)); } } }