Archive for September, 2007

Recently there have been many requests for a KryptonComboBox control. Well wait no longer because here it is! Actually you will have to wait because the next full release will not occur until around the end of the year. But at least you know it is in the pipeline. With yesterdays additional of a KryptonTextBox we are starting to round out the free Toolkit quite nicely.

Here you can see the KryptonComboBox on the left side in various different operational states, the right hand side has a couple of standard ComboBox controls. Showing with the popular Office 2007 Blue color scheme.

And now in the Professional System color palette…

The background and text colors are restricted to just solid colors in the same way as the KryptonTextBox, because of limitations in the way the underlying Win32 control can be overridden. It does have one useful addition though, an Active state that is defined as True when either the mouse is tracking over the control or the control has focus. When Active you can alter the appearance using the StateActive appearance properties. So if you want to highlight the control when it is active, so that users can easily see which control has focus, you can achieve it quickly without writing any code.

Making something as simple as a KryptonTextBox sound interesting is going to be tough work. In fact I don’t think I can manage it. Still, the KryptonTextBox is an essential additional to the Toolkit because it is hard to think of many client applications that do not need to use at least one. Our control is really just a standard windows TextBox placed inside a container that provides the correct colors to use and then draws the border manually.

Here you can see three KryptonTextBox instances on the left side and three standard WinForms TextBox instances on the right hand side. The Office 2007 Silver color scheme has been selected.

And now in the Professional Office 2003 palette…

Because the border is drawn by the Krypton renderer it means we can customize the border in the same way as any other Krypton control. So here it is with the thickness increased and some rounding added to the corners.

 

An additional feature that you might find useful is the Active state. When the control has the focus, or the mouse is tracking over the control, it is considered to be in the Active state. There is a property called StateActive that allows you to determine the appearance when Active. So in this example I can changed the border color to be Orange so that as the user moves the mouse over the control it highlights nicely.

There is a restriction with setting the appearance of the KryptonTextBox. The background and text colors can only be simple solid colors. Unlike other Krypton controls you cannot use a gradient effect or image as the source for painting the background/text. In practice this should not be too restrictive.

Krypton 2.6.1 Released

Use the following link to download
http://www.componentfactory.com/downloads/KryptonToolkit261.zip

This is a maintenance release that resolves a number of issues
with the new KryptonDataGridView. New classes added include…

KryptonDataGridViewTextBoxColumn
KryptonDataGridViewCheckBoxColumn
KryptonDataGridViewButtonColumn
KryptonDataGridViewLinkColumn

You should use these new column types in preference to the standard
column types in order to achieve the Krypton styled appearance.

Regards
Component Factory Pty Ltd

The last Krypton column type to be added is KryptonDataGridViewLinkColumn. As you can guess this is the Krypton analog to the standard DataGridViewLinkColumn. The only difference is that drawing is performed by the Krypton renderer to ensure consistency with the rest of the grid appearance.

 

The link and button Krypton columns and cells have a property that allows you to define the display style. For the link column you can set the LabelStyle and for the button column a ButtonStyle. You can define this at the column level or at the level of individual cells. Here are some different settings applied.

 

To change the appearance of the text box cells you use the existing properties such as GridStyles.DataCellStyle from the KryptonDataGridView instance. There is no style applied to the check box Krypton column as it pulls from the palette as specified for the KryptonDataGridView instance.

Another common usage of the DataGridView is to place buttons into one of the columns. This is such as common requirement that I have added a KryptonDataGridViewButtonColumn column type to make this easy. You can see it in action in the following image.

If we add together all three new Krypton column types we can see that a consistent grid can be created.