private void cmdBrowsePath_Click(object sender, EventArgs e) { openFileDialogJar.InitialDirectory = GetDirectory(txtPath.Text); if (openFileDialogJar.ShowDialog(this) == DialogResult.OK) { txtPath.Text = openFileDialogJar.FileName; } }