views:

151

answers:

3

I have an app with a bunch of controls in it and I want to place a set of cross hairs on top of it. My first attack used a PictureBox and ran into this problem. The solution that fellow proposes, seems a bit... verbose for what I need.

Is there a simple way draw on top of my form? Note that I don't even need the drawing to be part of a control as it doesn't need to do anything but just be there.

A: 

see my question. I was trying to gather all knowledge there:

dtroy
A: 

Does a PictureBox with a transparent image have the same problem as a Panel with BackColor set to Transparent? I'm thinking you could have a PictureBox with the crosshair image in it and move that around, instead of drawing it yourself...

lc
PictureBox is only transparent re it's parent. As far as other controls go, it paints over them with whatever it's parent would have panted there. There is a picture of that at the top of the link in the question.
BCS
A: 

This eventually worked. I had to play some games though because most of the controls I wanted to draw on were not where it expected them to be.

Also, it ran into issues when controls were moved; it failed to redraw and stuff moved with the underlying control. This was fixed by forcing invalidation from the move event for anything that might move.

BCS