Replace winform skin (top)-use existing skin

Source: Internet
Author: User

By accident, we encountered the problem of changing winform skin in winform.

WPF does not have this problem. The WPF controls have no shape and can be freely used as needed. You can implement various brilliant interface effects through intuitive coding, there are also many existing styles and templates on the Internet for your reference.

Compared with WPF, winform is not so lucky. It is relatively difficult to implement.

Baidu + Google found that there are basically two methods to solve winform skin replacement.

Implementation 1. Use existing skin. Advantages: it is easy to implement and basically requires no encoding. But pay attention to the details. Disadvantage: cannot be customized by yourself

Implementation 2. Complete GDI + painting. A bit: You can create personalized Interfaces Based on your personal interests. Disadvantage: It takes effort to complete a skin with good user experience, encoding amount and preparation of pre-image materials.

This article first introduces Implementation 1: using existing skin methods, the following blog will introduce implementation 2.

Implementation 1: The principle is very simple. You just need the third method class library to implement it like changing the topic.
Skincrafter http://skincrafter.com/
Irisskin http://www.sunisoft.cn/irisskin/index.htm
Dotnetskin http://www.dotnetskin.net/
More advanced infragistics netadvantage
Debuglzq does not verify all these third-party libraries. I just tried irisskin2.dll (download) and SSK skin file (download). There is a demo in this skin to view the effects of various skins.

There are several similar articles in the blog, but LZ tried it. The main problem is: Many articles refer to each other (you know .......), many of them have not tried it at all. The results are tried according to his steps. They cannot run, and the same problem exists. Unscrupulous people, wrong people!

The following step by step is used to implement this demo.

1. Create a winform project and put the above DLL file and SSK skin file under the bin/DEBUG directory of the project. And add references to this DLL file.

2. Add the following dummies in the form Cs file:

Namespace taskvision_v_javaswinform {// <summary> // winform skin demo /// by debuglzq // http://www.cnblogs.com/DebugLZQ /// </Summary> Public partial class form1: FORM {sunisoft. irisskin. skinengine Se = NULL; Public form1 () {initializecomponent (); Se = new sunisoft. irisskin. skinengine (); se. skinallform = true; // apply this skin se to all forms. skinfile = "skin/wavecolor1.ssk";} private void button#click (Object sender, eventargs e) {form2 F2 = new form2 (); f2.show ();}}}

Run the following command:

The black box in the middle is the datagridview control dragged by LZ.

Note that the third-party control requires a. NET Framework Version of up to 3.5. If you are using vs2010 or vs2012, you need to change the target version of the project.

The next blog post will introduce how to customize skin. Please wait...

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.