Bring A Rectangle To Front Of A PictureBox
My question is easy i think. But i couldnt succeed it. I have a PictureBox and a Rectangle Shape on my form. But the rectangle always stays behind the PictureBox. I couldnt take the Rectangle To the front of the PictureBox. I select Picturebox and clicked on "Send To Back" But it didnt work. Is there any way? Th开发者_运维知识库anks for everybody on this site for their help....
You cannot bring an autoshape in front of a control I'm afraid.
You can't do this in the Designer, but you can in your code. You need to call the BringToFront() method for the ShapeContainer containing your Rectangle (ShapeContainer1 by default) in the Load event handler for your form.
Although it doesn't seem like you should need to, I've found that I also needed to call the SendToBack() method for my PictureBox in my form's Paint event handler.
精彩评论