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
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
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
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
Thanks a lozt for your information
I'll look into these approaches
Best regards
Pierre-Jean