We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to implement VS.NET like XML tag insertion feature using WinForms SyntaxEditor (EditControl)?

Platform: WinForms |
Control: EditControl

Text handling

This can be used, while editing the XML language tags in the SyntaxEditor (EditControl).

The cursor can be placed at any positon of the line and the nodes will be inserted correctly in the beginning and the end of the current line. This feature saves time while editing your XML documents using the Essential Edit. Refer to the code attached to know more about it.


private void menuItem_Click(object sender, System.EventArgs e)
    if(this.accepted == true)
            MessageBox.Show("The node name cannot be empty");
            this.editControl1.InsertText(this.editControl1.CurrentLine,(this.editControl1.CurrentColumn)," ");
            this.editControl1.InsertTexthis.editControl1.CurrentLine,this.editControl1.CurrentColumn, "<"+this.inputString+">");
            this.editControl1.InsertText(this.editControl1.CurrentLine,(this.editControl1.CurrentColumn)," ");



Private Sub menuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles menuItem12.Click
     If Me.accepted = True Then
         If Me.inputString.Equals("") Then
             MessageBox.Show("The node name cannot be empty")
             Me.editControl1.InsertText(Me.editControl1.CurrentLine,(Me.editControl1.CurrentColumn)," ")
             Me.editControl1.InsertText(Me.editControl1.CurrentLine,Me.editControl1.CurrentColumn, "<"+Me.inputString+">")
             Me.editControl1.InsertText(Me.editControl1.CurrentLine,(Me.editControl1.CurrentColumn)," ")
         End If
     End If
End Sub


Reference link: https://help.syncfusion.com/windowsforms/syntaxeditor/editing#text-handling

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile