Archive for the ‘Krypton Toolkit’ Category

Due to popular demand, well at least 2 people anyway, I have added a Kryptonized version of the standard windows MessageBox funtionality. In order to make it fully backward compatible I have provided a set of static methods that have identical parameters to the existing MessageBox methods. So you need only perform a search and replace of the existing MessageBox.Show methods so they become KryptonMessageBox.Show instead.

Here you have some examples of the appearance using different palettes…

The text used in the buttons is localizable and exposed via the KryptonManager component. So if you need to define text for non-English systems you can update the new GlobalStrings property of the manager and all message boxes will then use those updated strings.

If you are using a Krypton application on Windows 7 machines then you need to be aware of a potential bug that is quite nasty. When using ShowDialog to show a window that derives from KryptonForm the window will sometimes not appear. This only seems to be the case when you have the Desktop Window Manager (DWM) enabled. It will effectively be invisible even though it has been successfully created.

For those now aware, the DWM is responsible for the Aero theme (sometimes known as the glass). Needless to say, your customers are going to be confused if a window is just plain missing. In fact your developers are going to be pretty confused as well.

The workaround for this is quite simple. You need to hook into the Shown event of the modal window and then add the following call to the PerformNeedPaint method:-

    private void Form1_Shown(object sender, EventArgs e)
    {
        PerformNeedPaint(true);
    }

I expect to release a maintenance release in about three weeks that will include this fix along with any other fixes and changes that accumulate between now and then.

This new release is smaller than usual but does contain a new Toolkit control called the KryptonTrackBar. It acts like the standard windows version allowing the user to drag a position indicator along a track. It also has the ability to draw the track as a triangle and so giving the appearance of a volume control. Always provided are a number of bug fixes and more minor additions.

Please download using the following direct link…

Download 4.2

Thanks to Serge Wautier for the idea of allowing the track bar to be a volumn control. I have added a VolumeControl property that is a simple boolean. When defined it just makes the track a big bigger and draws it as a wedge instead of a rectangle. A trivial change to the control but maybe it will be useful to a few developers that need such a control.

The KryptonTrackBar is now completed. 

It has a TrackBarSize enumeration property with three values of Small, Medium and Large. You can see the difference in sizing in the above image that shows them in size order. It has all the same properties as the standard windows control and so you can specify the tick marks to be below, above, both or none as needed. Above you can see the first three of those options displayed.

Altering the Orientation to vertical gives the following…

The above is drawn for the Professional System palette under Windows 7. The first image was using the Office 2010 Blue palette.