I'm using 3 pictureboxes. 1 as background & 2 as transparent layer over the background. all with same size. Layer 1 is used to draw lines & layer 2 to draw shapes. I'm using tab control to control which layer is visible and which is hidden. but somehow cant make both layer visible at the same time eventhough they both transparent.
The code I'm using
public Form1()
{
InitializeComponent();
bgLayer.Image = bmp;
bgLayer.Controls.Add(lineLayer);
bgLayer.Controls.Add(squareLayer);
lineLayer.Location = new Point(0, 0);
squareLayer.Location = new Point(0, 0);
lineLayer.BackColor = Color.Transparent;
squareLayer.BackColor = Color.Transparent;
}
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl1.SelectedIndex == 0)
{
lineLayer.Visible = true;
squareLayer.Visible = true;
lineLayer.Enabled = false;
squareLayer.Enabled = false;
}
else if (tabControl1.SelectedIndex == 1)
{
lineLayer.Visible = true;
squareLayer.Visible = false;
lineLayer.Enabled = true;
squareLayer.Enabled = false;
}
else if (tabControl1.SelectedIndex == 2)
{
lineLayer.Visible = false;
squareLayer.Visible = true;
lineLayer.Enabled = false;
squareLayer.Enabled = true;
}
}
Anyone know how to make both transparent layer visible at the same time? tab control 0 is both visible, 1 is picturebox1 only & 2 is picturebox3 only. Tab control 1 & 2 works fine but 0 only shows layer picturebox1.
tried adding lineLayer.Controls.Add(squareLayer);
but it makes the program buffers non stop when executed