$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Editors Control for Windows Forms
Powerful data input control for Windows application, flexible data entry controls, strict validation
Home > WinForms UI Controls > User Manual > Custom Blocks in C#

Custom Blocks Creating in C# with Editors WinForms Control

The Kettic Auto Completion Box Control is designed for .NET UI Designers to easily fill in text. This functionality resembles the behavior of To field of the Outlook, in which users can fill in the recipients to send a new message. There are various powerful features of the Auto Completion Box Control, such as the different layout modes, auto-complete in bound and unbound mode of Outlook style, theming mechanism and customizable appearance, selection and navigation, localizable context menu, and flexible and intuitive API.

C# Code for Creating Custom Blocks

In addition to support customizing appearance via the formatting event, the Kettic Auto Completion Box Control is also capable of replacing the default UI block representation. It is achieved by using the event, CreateTextBlock. To create custom text blocks, .NET developers need to create a block to inherit all features of ITextBlock and Element. The following are C# code that shows how to extend the default Element of Tokenized Text Block through adding a check box.

public class MyTokenizedTextBlockElement : TokenizedTextBlockElement
{
private CheckBoxElement checkBox;

protected override Type ThemeEffectiveType
{
get
{
return typeof(TokenizedTextBlockElement);
}
}

protected override void CreateChildElements()
{
base.CreateChildElements();

int index = this.Children.IndexOf(this.RemoveButton);
this.checkBox = new CheckBoxElement();
this.checkBox.StretchVertically = true;
this.checkBox.StretchHorizontally = false;
this.Children.Insert(index, this.checkBox);
}
}
Now we can use the following C# code to replace the default text block in the event handler, CreateTextBlock

private void autoCompleteBox_CreateTextBlock(object sender, CreateTextBlockEventArgs e)
{
if (e.TextBlock is TokenizedTextBlockElement)
{
e.TextBlock = new MyTokenizedTextBlockElement();
}
}
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls