$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Text Box Control for Windows Forms
Highly customizable and themable Text Box Control for Windows Forms C# project
Home > WinForms UI Controls > User Manual > Custom Blocks in C#

Custom Blocks Creating in C# with Text Box Control

The Kettic Text Box Control is designed for .NET UI Designers to easily fill in text to Text Box. There are various powerful features of the Text Box Control, such as the different layout modes, auto-complete in bound and unbound mode, 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 Text 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 create a button that implements ITextBlock interface.

public class ButtonTextBlock : KetticButtonElement, ITextBlock
private int index;
private int offset;

public ButtonTextBlock()
this.index = 0;
this.offset = 0;
this.MaxSize = new Size(2, 14);

Now, we can subscribe to the CreateTextBlock event and then initialize the Text property in the Kettic Text Box Control.

ketticTextBoxControl.CreateTextBlock = new CreateTextBlockEventHandler(ketticTextBoxControl_CreateTextBlock);

void ketticTextBoxControl_CreateTextBlock(object sender, CreateTextBlockEventArgs e)
if (e.Text == "Now")
e.TextBlock = new ButtonTextBlock();
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