)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the controls on the Configuration Editor dialog in WinForms SyntaxEditor (EditControl)?

Platform: WinForms |
Control: EditControl |
Published Date: April 30, 2011 |
Last Revised Date: December 13, 2019

Show or hide tab pages and rename buttons

You could selectively show or hide the TabPages and rename the Buttons on the Configuration Editor dialog as shown in the method below.

C#

private frmConfigDialog CustomizeConfigDialog (frmConfigDialog form)
{
    foreach (Control ctrl in form.Controls)
    {
       if (ctrl is Button)
       {
           Button btn = (Button) ctrl;
           if (btn.Text == "&OK")
               btn.Text = "&Apply";
       }
       // Get the TabControl in the ConfigDialog form
       else if (ctrl is TabControl)
       {
           TabControl tabControl = (TabControl) ctrl;
           TabPage formatsPage = null;
           // Get the Formats TabPage
           foreach (TabPage page in tabControl.TabPages)
           {
                if (page.Text == "Formats")
                   formatsPage = page;
           }
           // Clear all TabPages in the TabControl
           tabControl.TabPages.Clear();
           // Add only the Formats TabPage
           tabControl.TabPages.Add(formatsPage);
       }
    }
    return (frmConfigDialog) form;
}

 

VB

Private Function CustomizeConfigDialog(form As frmConfigDialog) As frmConfigDialog
    Dim ctrl As Control
    For Each ctrl In form.Controls
        If TypeOf ctrl Is Button Then
           Dim btn As Button = CType(ctrl, Button)
           If btn.Text = "&OK" Then
              btn.Text = "&Apply"
           End If
           ' Get the TabControl in the ConfigDialog form
           ElseIf TypeOf ctrl Is TabControl Then
              Dim tabControl As TabControl = CType(ctrl, TabControl)
              Dim formatsPage As TabPage = Nothing
               ' Get the Formats TabPage
              Dim page As TabPage
              For Each page In tabControl.TabPages
                 If page.Text = "Formats" Then
                    formatsPage = page
                 End If
              Next page ' Clear all TabPages in the TabControl
              tabControl.TabPages.Clear()
              ' Add only the Formats TabPage
              tabControl.TabPages.Add(formatsPage)
           End If
    Next ctrl
    Return CType(form, frmConfigDialog)
End Function 'CustomizeConfigDialog

 

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
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
Live Chat Icon