In the form of the onload first make the form invisible, and then from the inside out, one layer to draw rectangle, and finally let the form visible
Difficulties
The first output of the rectangle to have a place to show that the Main form is not, because when the rectangle, the form is not visible, here using the desktop desktop
"Code as follows"
1. Join namespaces
Using System.Drawing.Imaging;
Using System.Runtime.InteropServices;
2. Declaring Win32 Api GetDC ()
[DllImport ("user32")]
public static extern system.intptr GetDC (system.intptr DC);
3. Declaring variables
System.Drawing.Graphics G; Draw a tablet
Pen p=new Pen (color.black,1); Brush
int startx,starty,wx,wy,step; Startx,starty,wx,wy determines a rectangle
int cx,cy; Cx,cy the width and height of the client for form
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service