WinForm Interface Design Optimization process

Source: Internet
Author: User
Tags set background

Take the project as an example, record the interface beautification process encountered problems, because the project is done first, and then please the artist to slightly adjust the design interface, so there will be some restrictions

1. TabControl problem----After adding a background image, the TabControl label cannot be added to the background image, and the background cannot be set.

There are two ways to solve this problem: reference: 80652443

A) redraw the TabControl----Set the DrawMode property to OwnerDrawFixed, and then add the event DrawItem, but I don't know if the performance is significant. After redrawing the label and background, and setting the page background to the overall background, the following override controls can be set to transparency directly, eliminating some hassle.

b) Although the overriding method can be used to modify the This.tabcontrol=new Tabcontrolex () in the interface Designer.cs, the call succeeds, but after the x64 bit is compiled, it is not possible to drag the control directly onto the interface for any reason.

However, the override method can enable Tcontrol transparency, and so on, but after setting the page transparency, finally found the page load control compare card, not set transparent page not card. I don't know the exact reason.

2. GroupBox border problem----in the project, originally used GroupBox for typesetting, now beautify the interface set background picture, GroupBox and very obvious border, look not very good looking.

Solution: First look for the border method, the online method to provide methods to rewrite the method OnPaint ()

Private void groupbox10_paint (object  sender, PaintEventArgs e)        {            e.graphics.clear (  this. BackColor);                   }

After the test, found that the GroupBox directly connected to the background of the picture has become white, decisively give up, after the panel to replace the GroupBox, set the background picture, there is no border problem.

3. The main problem is that after the overall layout is set up, the running program discovers that the card is deadly. Online Search Data Summary reference: Https://www.cnblogs.com/kest/p/4683012.html.

After the CreateParams overload, the page is waiting for all the controls to be fully loaded, snapped out all out, there is a wait process, followed by analysis, is the TabControl page setting transparent cause waiting time too long. Finally decided to no longer use TabControl, directly add the button jump page, there is not so many problems.

WinForm Interface Design Optimization process

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.