This is a migrated thread and some comments may be shown as answers.

Font Dialog Hide "Effects" , "Sample", "Script"

4 Answers 192 Views
BrowseEditor
This is a migrated thread and some comments may be shown as answers.
pierre-jean
Top achievements
Rank 1
Veteran
Iron
pierre-jean asked on 27 Nov 2019, 11:23 AM

Hello

in the FontDialog of the RadBrowseEditor is it possible to hide the three elements:
- Effects
- Sample
- Script

Thanks in advance

Pierre-Jean

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 27 Nov 2019, 12:59 PM

Hello, Pierre-Jean,

Note that RadBrowseEditor uses the standard MS FontDialog. It offers the ShowEffects property which controls whether to show the Effects part or not. However, I haven't found any properties for controlling the Sample and Script sections.

The following code snippet demonstrates how you can access the FontDialog and manipulate some of its properties: 

        public class CustomBrowseEditorElement : RadBrowseEditorElement
        {
            protected override Type ThemeEffectiveType
            {
                get
                {
                    return typeof(RadBrowseEditorElement);
                }
            }

            protected override FontDialog CreateFontDialog()
            {
                FontDialog fontDialog = new FontDialog();
                fontDialog.ShowApply = false;
                fontDialog.ShowEffects = false;
                fontDialog.AllowScriptChange = false;
                return fontDialog;
            }
        }

        public class CustomBrowseEditor : RadBrowseEditor
        {
            public override string ThemeClassName
            {
                get
                {
                    return typeof(RadBrowseEditor).FullName;
                }
            }

            protected override RadBrowseEditorElement CreateEditorElement()
            {
                return new CustomBrowseEditorElement();
            }
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 27 Nov 2019, 01:09 PM

Hello and thank you for your information

I'll try using your code snippet, but as it does not allow the "hidding" of the other elements I see no major advantage in using it.

Thanks anyway

Best regards

Pierre-Jean

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Nov 2019, 08:44 AM

Hello, Pierre-Jean,

Since it is the standard MS FontDialog, we don't have control over it except the public API that it exposes. 

An alternative solution that I can suggest is to create your own form for selecting the font. Telerik UI for WinForms suite offers a RadFontDropDownList which represents a drop down list with built-in fonts that are installed on the system. It may be suitable for your case.

In the custom RadBrowseEditorElement, you can override the OnBrowseButtonClick method and show the form you want. After the form is closed, it is necessary to update the value in RadBrowseEditor.

Feel free to use this approach which suits your requirements best.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 28 Nov 2019, 02:32 PM

Thanks a lozt for your information

I'll look into these approaches

Best regards

Pierre-Jean

Tags
BrowseEditor
Asked by
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Share this question
or