Application.enablevisualstyles ();

Source: Internet
Author: User
<span id="Label3"></p><p><p>Application.enablevisualstyles ();<br>Application.setcompatibletextrenderingdefault (false);<br>Application.Run (new Login ());</p></p><p><p></p></p><p>1. The role of Application.enablevisualstyles () is to activate the display style of the application, and the display style is the various elements that make up the operating system theme, such as color, font, etc. If the control and OS support, then the control will be drawn according to the display style to Implement. The call to the method must actually be earlier than the creation of any one of the Controls. Usually it is in the first row of the main function and is added automatically in the integrated development Environment. See: http://msdn.microsoft.com/en-us/library/system.windows.forms.application.enablevisualstyles.aspx<br><br>2. Setcompatibletextrenderingdefault ()<br>Some form controls can use the TextRenderer class when coloring their text or use the graphics class. The TextRenderer class is based on the GDI graphics library, while the graphics class is based on the GDI + Library. The coexistence of these two types starts with The. NET Framework 2.0, partly for performance reasons, and partly because of GDI + localization Issues. If the control supports the Usecompatibletextrenderingproperty property, the method sets this property to the default Value.<br>The UseCompatibleTextRendering property is used for compatibility with form controls that use the TextRenderer class and applications under THE. NET Framework 1.0 AND. NET Framework 1.1 that use the Graphics class. If you are not upgrading from version 1.0 or 1.1, it is recommended that you set this property to False.<br><br>Do not call this method except for the form Application.<br><br>As for why the gdi-based TextRenderer class is present on msdn, I don't want to translate any more. Mainly based on performance, aesthetics and other considerations, as well as the compatibility of multi-language Fonts.<br><br>3. Application.Run (new Login ());<br>I guess your login should be a form class, not a applicationcontext class. For a form, The Run method launches a standard application message loop in the current thread, plus it displays your login form</p><p><p>Application.enablevisualstyles ();</p></p></span>

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.