Good,
I have an OpenFileDialog in my program, but I did not want it to appear when I "open" what is in the image ... If I close the window, it gets "openfiledialog" in the Textbox, and I want it to be blank, since nothing was selected.
Image:
Code:
privatevoidbutton1_Click(objectsender,EventArgse){openFileDialog1.Filter="Request File (*.CSR)|*.csr|Configuration File (*.CNF)|*.cnf";
DialogResult resposta = openFileDialog1.ShowDialog();
if (resposta == DialogResult.OK)
{
string arquivo = openFileDialog1.FileName;
VariaveisGlobais.cnf = arquivo;
VariaveisGlobais.csr = label2.Text;
}
textBox3.Text = string.Format("{0}", openFileDialog1.FileName);
label2.Text = Path.GetFileNameWithoutExtension(openFileDialog1.FileName);
button2.Enabled = Path.GetExtension(openFileDialog1.FileName) == ".cnf";
button3.Enabled = Path.GetExtension(openFileDialog1.FileName) == ".csr";
button4.Enabled = Path.GetExtension(openFileDialog1.FileName) == ".csr";
}