CSharp .Net Tutorial: How to Skin Your Forms

James Cloud
Skins are becoming more and more used with the popularity of Vista styles and other cool looking application skins. It would be great to make your own application using these types of skins right? However, upon doing a simple good search for a .Net skinning library you will promptly discover that to easily achieve styling your form will cost you at least $200 to $500. This might be a fine price for larger development companies but for personal developers or small teams it is totally off the charts.

This being said, let's introduce the only free alternative to the $500 skinning .Net Libraries. It's name is USkin and you can download it for free here:

http://www.neemedia.com/newsite/index.php?entry=entry081110-153248

USkin allows the developer to apply any .msstyles file to his or her desired form. USkin allows you to change to to different msstyles files even during runtime. It also gives you the ability to use different styles for different forms.

This tutorial will show you how to load an msstyles file and apply it to your CSharp .Net application.

Free Skinning Alternative - USkin

After downloading the USkin package put USkin.dll into the same folder as the compiled exe. You will need to distribute this library with the compiled project for USkin to work properly. Also, place the USkin.cs file into your project's source files folder and include it in your project like so:

Project ->Add Existing File

Then select USkin.cs and press Add.

Now, all you need to do to load and apply an msstyles file to your form is execute the USkinInit function. Here is an example usage of USkinInit:

USkinSDK.USkinInit("", "", C:\\My\\Path\\MyStyle.msstyles");

Conclusion

When you start your compiled application you should see the style visually applied. When you distribute the compiled version of your project make sure to include your msstyles file and USkin.dll in the package, otherwise your application will not work properly and might even crash.

Published by James Cloud

I like to program and do basically anything that has to do with technology and computers.  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.