Telerik UI for WinForms

RadTextBoxElement is created for the purpose of reusability, as it is not a control, but an element ( Refer to Telerik Presentation Framework section about the difference. ) e.g. RadTextBoxElement can be used in RadGridView control.

This image shows the Control Element Structure of the Telerik RadTextBox as displayed by Visual Style Builder:

editors-textbox-control-element-structure 001
  • FillPrimitive and BorderPrimitive set the overall background and border properties of the control.

  • The most important node is RadTextBoxItem which hosts the standard.NET TextBox control. There are several implications because of that:

    • The first is that this node cannot be themed

    • And the second is that events hierarchy is broken at that place e.g. mouse click in the text box field does not propagate to the root element (RadTextBox control).

You can use the following code snippet to access RadTextBoxItem and subscribe to the click event:

Copy[C#] Subscribing for the click event of the RadTextBoxItem
this.radTextBox1.TextBoxElement.TextBoxItem.Click += new EventHandler(TextBoxItem_Click);
Copy[VB.NET] Subscribing for the click event of the RadTextBoxItem
AddHandler RadTextBox1.TextBoxElement.TextBoxItem.Click, AddressOf TextBoxItem_Click