Well, I have the following code in my program:
CODE
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Ficheiro de Configuração (*.cnf)|*.cnf|Ficheiro de Request (*.csr)|*.csr";
DialogResult resposta = openFileDialog1.ShowDialog();
if (resposta == DialogResult.OK)
{
string arquivo = openFileDialog1.FileName;
VariaveisGlobais.CNF = arquivo;
VariaveisGlobais.CSR = label2.Text;
}
label2.Text = Path.GetFileNameWithoutExtension(openFileDialog1.FileName);
button2.Enabled = true;
button3.Enabled = true;
textBox3.Text = openFileDialog1.FileName;
}
As you can see, when FileDialog receives something, it puts the button2 and button3 = Enabled. What I want now is that if the user chooses a .cnf file the button2 becomes Enabled = true; and button3 Enabled = false;
And if you choose the .csr file the reverse. Can you help? Thank you.