WinForm How to remove the white edges on the right and the top

Source: Internet
Author: User

The system gives a lack of aesthetics to the form style, want a beautiful UI can do it by itself, it is easy to implement

1. Create a new form, at which point Formborder is None

At this point the form has only one panel (the default panel with the form), no border, no title bar (control button)

2. Drag into a panel overlay on the default panel above "This step is very necessary"

There is no difference between the form and the form that you get from the first step.

As for why to do so, because: if you do not, the form will be surrounded by a few white edges, especially the right and bottom, there must be a width of 4 pixels of white edge, add a panel overlay on the top there will be no white edge problem.

3. Set the panel background image

Note here: If there is a transparent pixel in the background image, be sure to set the panel's BackColor to Transparentkey, otherwise there will be a black edge problem

4. Draw the custom control and add it to the panel

button what you can draw yourself, you can also find open source control, such as "Crystal Button"

5. If such a UI does not meet the requirements of the project, you can search for "translucent form", "irregular shape form", "circular button" and the like, the practice is not detailed here

-------

Custom UI It's done here, and I'm going to reiterate the white-side problem.

Under what circumstances will white edges appear?

The backgroundimage of the borderless form is set directly, and the background image is bound to appear with white edges, like this:

Around this circle of white edge damage the beauty of the whole form, give a very thick feeling, and good UI, like the form of QQ, give a very light feeling, look very comfortable

After removing the white edges as described above, the form becomes this way:

Now look more comfortable, of course, here also use a rounded rectangle form, look at the comparison with the sense of

Rounded rectangles are not difficult to implement, overriding the resize method of a form, setting the region property of a form inside a method as a self-drawn rounded rectangle.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.