private void button1_Click(object sender, EventArgs e) { OpenFileDialog d = new OpenFileDialog(); d.Title = "Open File"; d.InitialDirectory = System.IO.Path.GetDirectoryName(Application.ExecutablePath); d.RestoreDirectory = true; d.Filter = "CSV Files (*.csv)|*.csv"; if(d.ShowDialog() == DialogResult.OK && Path.GetExtension(d.FileName) == ".csv") { try { graph g = new graph(this.MdiParent, d.FileName); g.Show(); } catch { } } }
private void button1_Click(object sender, EventArgs e) { OpenFileDialog d = new OpenFileDialog(); d.Title = "Open File"; d.InitialDirectory = System.IO.Path.GetDirectoryName(Application.ExecutablePath); d.RestoreDirectory = true; d.Filter = "CSV Files (*.csv)|*.csv"; if (d.ShowDialog() == DialogResult.OK && Path.GetExtension(d.FileName) == ".csv") { try { graph g = new graph(this.MdiParent, d.FileName); g.Show(); } catch { } } }