//private void listBox_DoubleClick(object sender, EventArgs e) //{ // if (!string.IsNullOrEmpty(listBox.SelectedItem as string)) // { // DialogResult = DialogResult.OK; // this.Close(); // } //} private void btnOK_Click(object sender, EventArgs e) { if (!(txtFileName.Text.Equals(String.Empty))) { MySQLDatabase mySQLDatabase = new MySQLDatabase(); mySQLDatabase.SetDataSourceFilePath(this.txtFileName.Text); this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("Please choose a server."); } }