private void Browse_Click(object sender, EventArgs e)
{
if (label2.Text == "0/20")
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
if (label2.Text == "0/20")
{
label2.Text = "1/20";
}
else
{
}
}
}
if (label2.Text == "1/20")
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox2.Text = openFileDialog1.FileName;
if (label2.Text == "1/20")
{
label2.Text = "2/20";
}
else
{
}
}
}
if (label2.Text == "2/20")
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
if (label2.Text == "2/20")
{
label2.Text = "3/20";
}
else
{
}
}
}
if (label2.Text == "3/20")
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
if (label2.Text == "3/20")
{
label2.Text = "4/20";
}
else
{
}
}
}
if (label2.Text == "4/20")
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
if (label2.Text == "4/20")
{
label2.Text = "5/20";
}
else
{
}
}
}
if (label2.Text == "5/20")
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
if (label2.Text == "5/20")
{
label2.Text = "6/20";
}
else
{
}
}
}
There is a problem, I can't make the openfiledialog to stop opening up, I want it so that you click it once it opens for that textbox, click 2nd it opens for that 2nd text box and so on, can any help?

New Topic/Question
Reply



MultiQuote




|