void MnImportConfigClick(object sender, EventArgs e) { string filename = null; using (System.Windows.Forms.OpenFileDialog ofd = new OpenFileDialog()) { ofd.Filter = "GCODE Files|*.nc;*.gcode"; ofd.CheckFileExists = true; ofd.Multiselect = false; ofd.RestoreDirectory = true; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { filename = ofd.FileName; } } Core.ImportConfig(filename); }