Maybe this is a dummy question but as I am not a C# expert I think this function could be written better with using fewer lines of code.
Here it is:
public void chgnav(string wt, string nav)
{
if (wt == "enable")
{
if (nav == "prev")
{
pictureBox7.Visible = true;
pictureBox9.Visible = false;
}
else
{
pictureBox8.Visible = true;
pictureBox10.Visible = false;
}
}
else
{
if (nav == "prev")
{
pictureBox7.Visible = false;
pictureBox9.Visible = true;
}
else
{
pictureBox8.Visible = false;
pictureBox10.Visible = true;
}
}
}
Edit: Thanks to everyone, upvotes from me. I got what I was looking for.
Edit: fixed