简体   繁体   中英

Draw a overlaying rectangle (example)

How would I go about drawing a rectangle like this image? (Notice rectangle slight grey in the middle) Screenshot

I've got drawing Rectangles on Forms/PictureBox's ect but for the of me can't figure out how to do it over all your open applications.

Any feedback will be much appreciated

如果只需要边框,则可以使用ControlPaint.DrawReversibleFrame

You need to create a window that is set to the size of the display. No border, no background. Basically, an invisible window. Then you can draw rectangles or whatever else you want and they will appear to be overlaid on top of other things.

Keep in mind you cannot keep this window open all the time as it will cover up everything else and prevent events from getting through. Open it as needed and then close it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM