I have created a usercontrol which has transparent background. I use this usercontrol on windows form and do some animation stuff on control when a button is clicked. myctrl is usercontrol created in windows form. Below is code :
private void button1_Click(object sender, EventArgs e)
{
Point p1 = new Point(myctrl.Location.X, myctrl.Location.Y);
for (int i = 0; i < 100; i++)
{
myctrl.Location = new Point(p1.X + i, p1.Y + i);
myctrl.Update();
pictureBox1.Update();
i++;
Thread.Sleep(100);
}
}
Problem : Once loop starts usercontrol is not visible and when loop ends control is visible. Also, I'm placing the control on picturebox which is placed on winforms.