0

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.

Andrew Morton
25.3k9 gold badges66 silver badges96 bronze badges
asked Jul 14, 2009 at 6:08

2 Answers 2

1

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.

answered Jul 14, 2009 at 7:04
Sign up to request clarification or add additional context in comments.

Comments

0

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...

answered Jul 14, 2009 at 6:38

1 Comment

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.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.