Latest Posts

.

A Free alternative to give your .Net apps a customized look and Feel - Using Component Factory Krypton Tool Kit

{ Posted on 10:51 PM by Vivek }
Tags :

 

I ‘ve been for a long time searching for a way to skin my applications and give them a customized look and feel. I know that its fairly easy in Java, but in winforms its a real pain in the rear. There are a lot of fancy and lucrative options available for doing this in .Net, but only a precious few are free, one of them is the Component factory’s Krypton Tool kit.  It took stackoverflow.com about 8 hours to come up with this . Actually a SO user called renick kindly pointed me at this wonderful component. I felt so happy that i thought, I’d share this little piece of info, hence this blog post.

First a little background on the Krypton Tool Kit. Its part of the commercial Krypton Suite from component factory. While the suite itself costs a fortune, the tool kit is free. Which is sweet, because that means the basic UI elements such as the Text fields , and combo boxes are free.

You can get it by visiting

http://www.componentfactory.com/download

You’ll have to register with your email ID, which sucks I know, but trust me its worth it.

I assume that you are familiar with Visual Studio ,.Net and  the standard drills such as adding references etc.,

Once you’ve downloaded the suite (along with the toolkit)

kryptsetup

and installed it.

You’ll have free access to the tool kit.

ComponentFactory.Krypton.Toolkit.dll

Containing

KryptonTextBox

KryptonCheckBox….

you get the idea ..

The full suite features

The office Ribbon Control

and the fancy stuff are trial only

 

which consequently means

your UI changes from Being boring like this

lameui

To looking good like this

kryptonform

The catch here is that the Ribbon part is licensed commercially (though its free for trial), but there are a lot of free versions of “Office Ribbon” like controls out there.

But all other controls are free.

 

How do I do It

The easy way is to Create a New Project,

since it provides some nice project templates

image

But the problem is the Templates vanish once you’ve uninstalled the trial.

So here’s a little hack to get the Tool Kit Assembly

The assemblies are not placed in the Global Assembly Cache, instead at  (You know where):\Program Files\Component Factory\Krypton Toolkit 4.1.1\Bin\

like so

image

You may copy the Tool kit Library, since it’s license is free.

(Note: after acquiring the library, you may as well ditch the installed software.)

You can place the assembly where ever you like and add reference to your heart’s content.

 

image

Now as you’ve probably noticed this tool box section doesn’t feature a form (nor does the standard tool set)

For that you have to inherit your normal form from the class

ComponentFactory.Krypton.Toolkit.KryptonForm.

 

using System.Windows.Forms;
using ComponentFactory.Krypton.Toolkit;
namespace WindowsFormsApplication
{
    public partial class Form1 : KryptonForm

    {
        public Form1()
        {
            InitializeComponent();
        }

………….

………..

 

To change the theme of the form and its child element theres a component called KryptonManager in the Tool Box

which provides a property (enum) called

KryptonManager.GlobalPalletteMode

which can be set to any one of the following

image 

The one that was immediately interesting to me was the “Custom” option.

The Palette (in this context it means, a definition of “what” should be in “what” color) Definition for each theme is defined as a KryptonPalette class.

The component features a design time functionality, using which we can export the theme or import custom ones as plain XML files.

image

I encourage you to experiment with the custom theme , because that's where you can do some serious damage !

Chow !

Vivek

3 Response to "A Free alternative to give your .Net apps a customized look and Feel - Using Component Factory Krypton Tool Kit"

Can we make use of the same in Web applications.

Your comment about the Krypton Suite "costing a fortune" is a little unfair. The company I work for have recently been reviewing the options for obtaining a suite of components for providing dockable Windows a la the Visual Studio experience, and Component Factory came out streets ahead of the competition on price. You can normally expect to pay $2000 or more for such components, whereas for the Krypton suite it was $499 - with one years support built in. The value for money option with Component Factory speaks volumes for the company.

I should add for completeness to the above that when you purchase the Krypton suite you get all of the source code for that suite (and the toolbox components which you refer to). With other companies you have to pay extra for the source code.

I do not work for nor am I related in any way to the guy that runs Component Factory. I am just a very happy bunny in respect of the value that his solution represents.

Post a Comment