Skinners working with GUI development on C# are often interested in the question of how to make the face of their projects stylish. And at the same time they don’t want to spend a lot of time on it. With several lines of C# code presented here you can reach the result you wish by integrating SkinCrafter.Net component in your program. It was specially developed for those who choose .Net Framework for theirs projects. Owing to skin .Net component you can make an eye-catching C# skins for your program from scratch.
Sample code presented below illustrates how to integrate SkinCrafter .Net component and apply C# skins working with Window Forms (.Net platform):
Add C# skins to your application easily
To use SkinCrafter.Net for adding C# skins to your project, you need to create a single instance of SkinCrafter on your main form and set all the parameters in Properties
Open your project, and go to design mode
Right click on your Toolbox, and select «Insert Item» menu
Browse for skincrafter.net dll and click «Ok», which will result in adding SkinCrafter entry in toolbox panel
Drag and drop a single instance of SkinCrafter on your main form.
Set up license information and select skin file
Build and run your project, it should be skinned with selected skin
A 32-bit process is unable to load a 64-bit module and vice-versa. So if an assembly is compiled specifically to target 64-bit platform, Visual Studio will not be able to add it to toolbox, hence the error appears. To overcome this error it is necessary to add a reference to the assembly
Open your project
Right click on Reference
Choose «Add reference»
Go to SkinCrafter installation directory (SkinCrafter instalattion directory\SkinCrafterDotNet\)
Find and select skincrafter_.net2.0_vs2005_x64.dll and then click OK
// The code in CODE SECTION has to be called in Main() function, // before Application.Run() using DMSoft; … DMSoft.SkinCrafter.Init(); /* ———— Begin of CODE SECTION ————- */ DMSoft.SkinCrafter SkinOb = new DMSoft.SkinCrafter(); SkinOb.InitLicenKeys(”SKINCRAFTER”,”SKINCRAFTER.COM”, “email@example.com”,”DEMOSKINCRAFTERLICENCE”); SkinOb.InitDecoration(true); /* ———— End of CODE SECTION ————- */ SkinOb.LoadSkinFromFile(”D:\\Skin.skf”); SkinOb.ApplySkin(); Application.Run(new Form1()); SkinOb.DeInitDecoration(); DMSoft.SkinCrafter.Terminate();
Note : If you plan using Calendar control in your application, please switch off Visual styles for proper drawing of Calendar Control. So please comment the string :
in the file program.cs if it exists.