Articles in this section
Category / Section

How to implement AutoComplete in WinForms with RichTextBox control?

3 mins read

To implement WinForms AutoComplete with RichTextBox control, we need to implement the IEditControlsEmbed interface in a RichTextBox class which, will enable the AutoComplete functionality for the RichTextBox control.

C#

//RichTextBox inherits IEditControlEmbed interface
class CustomRichTextBox : System.Windows.Forms.RichTextBox, IEditControlsEmbed
{
System.Windows.Forms.Control IEditControlsEmbed.GetActiveEditControl(IEditControlsEmbedListener listener)
{
return (Control)this;
}
}

VB

 
  â€˜RichTextBox inherits IEditControlEmbed interface
   Friend Class CustomRichTextBox Inherits System.Windows.Forms.RichTextBox Implements IEditControlsEmbed
   Private Function GetActiveEditControl(ByVal listener As IEditControlsEmbedListener) As System.Windows.Forms.Control Implements IEditControlsEmbed.GetActiveEditControl
   Return CType(Me, Control)
   End Function
   End Class

Conclusion

I hope you enjoyed learning about how to implement AutoComplete in WinForms with RichTextBox.

You can refer to our WinForms AutoComplete page to know about its other groundbreaking feature representations. You can also explore our documentation  to understand how to present and manipulate data.

For current customers, you can check out our WinForms components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our Winforms EditControl and other WinForms components.

If you have any queries or require clarifications, please let us know in the comment section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!


Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied