Category / Section
How to plug in a custom text box into the ComboBoxExt's editable region
2 mins read
Here is how you would plug in a custom text box:
C#
// Your custom textbox class.
public class MyTextBox : TextBox
{
public MyTextBox()
{
}
}
// Custom ComboBoxExt class that plugsin the above MyTextBox type.
public class MyComboBoxExt : ComboBoxExt
{
// Plugin your custom textbox class.
protected override TextBox CreateTextBox()
{
return new MyTextBox();
}
}
VB
Public Class MyTextBox Inherits TextBox
Public Sub New()
End Sub 'New
End Class 'MyTextBox
' Custom ComboBoxExt class that plugsin the above MyTextBox type.
Public Class MyComboBoxExt Inherits ComboBoxExt
' Plugin your custom textbox class.
Protected Overrides Function CreateTextBox() As TextBox
Return New MyTextBox()
End Function 'CreateTextBox
End Class 'MyComboBoxExt