NET application how to batch XP on the cloak?

Source: Internet
Author: User
The development controls provided by the program NET Framework are also too small and too ugly to be a good result when drawn from a painting that is time-consuming and laborious. If we can run our programs in an XP environment that can automatically apply XP to a theme style it will save time and let Microsoft Paint the controls for us! Here are the solutions I've tried:

1.application.enablevisualstyles method (only available with. NET 1.1 and later version support)

Executes the Application.Run (...) in the main method. method, you can let the controls in the next running application automatically apply the style of XP by performing the Application.enablevisualstyles () method first. However, there are a few points to note:

All controls must remain in a preset state and cannot change properties such as their border style and background color. If you have a style attribute for the system option (such as the button's FlatStyle), you must select System;

This method works perfectly in WIIN2003, but the icons on the toolbar in Win XP are not displayed. (This may be an XP bug, the problem can be solved by a seed method);

2. Add manifest file (for all Windows applications)

By adding a yourApplicationName.exe.manifest XML file to the same directory as the execution file, we can quickly implement our requirements, which are as follows (add an underscore to the need for appropriate changes):

<?xml version= "1.0" encoding= "UTF-8" standalone= "yes"?>

<assembly xmlns= "urn:schemas-microsoft-com:asm.v1" manifestversion= "1.0" >

<assemblyidentity



version= "1.0.0.0"

Processorarchitecture= "X86"

Name= "COMPANYNAME.PRODUCTNAME.YOURAPP"

Type= "Win32"

/>

Your Application description here.



Type= "Win32"

Name= "Microsoft.windows.common-controls"

version= "6.0.0.0"

Processorarchitecture= "X86"

Publickeytoken= "6595B64144CCF1DF"

Language= "*"

/>




I've changed a lot of different apps in this way, and it's been a success. However, you can only apply controls that hold Windows preset properties. Its implementation is that all the controls in Windows are drawn to a ComCtl32.dll component. The previous highest version of XP was a 6.0 ComCtl32.dll in the 5.0,XP, and we've done this to inform the application to use t.6.0 ComCtl32 to show the controls.




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.