I have a panel with three groupboxes. Each groupbox has its control(combobox, labels, textboxes etc.). Groupbox1 is default when the panel is loaded. A combobox with two items determines when groupbox2 becomes visible while groupbox1 disappear so that the user can input certain information in it.
from properties, groupbox1: visible = "true" groupbox2: visible = "false" groupbox3: visible = "false"
My intention is that,
1) Item one does nothing when selected since default groupbox1 and its controls are already visible.
2) Item two makes groupbox1 and its controls hidden and groupbox2 and its controls visible. A combobox with similiar function is in groupbox2 exist to enable the switch back to the groupbox1 is item two is selected.
All this is supposed to occurs during runtime.
There is a third groupbox3 which is triggered by a button on the panel. I intend to make the groupbox3 visible whilst making everything on the panel look dim until a close button is clicked on groupbox3. i want to be able to make changes in the labels in groupbox1 and groupbox2 using a combobox control in groupbox3.
My Problem is
1)how do i make groupbox1 or groupbox2 on the panel appear faded and not totally hidden, while groupbox3 pops up like a messagebox,and also when i click a close button on groupbox3, groupbox3 closes while groupbox1 or groupbox2 becomes visible again
What I have tried:
private void panel1_Paint(object sender, PaintEventArgs e)
{
}
private void cb1_SelectedIndexChanged(object sender, EventArgs e)
{
gb1.Visible = cb1.SelectedIndex == 0;
switch (cb1.SelectedIndex)
{
case 0:
gb1.Visible = true;
gb2.Visible = false;
break;
case 1:
gb2.Visible = true;
gb1.Visible = false;
break;
}
}
private void cb2_SelectedIndexChanged(object sender, EventArgs e)
{
gb2.Visible = cb2.SelectedIndex == 0;
switch (cb1.SelectedIndex)
{
case 0:
gb2.Visible = true;
gb1.Visible = false;
break;
case 1:
gb1.Visible = true;
gb2.Visible = false;
break;
}
}
private void bt1_Click(object sender, EventArgs e)
{
gb3.Show();
gb1.Hide();
gb2.Hide();
}
private void bt2_on_gb3_Click(object sender, EventArgs e)
{
gb3.Hide();
gb1.Show();
gb2.Show();
}