Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4028
FontDialog not behaving how I expect
posted

I want to use the infragistics FontDialog (Infragistics.Win.SupportDialogs.FormattedTextEditor.FontDialog) to allow users to select a font. I am trying to do so using this code:

Code Snippet
  1. Infragistics.Win.SupportDialogs.FormattedTextEditor.FontDialog fontDialog = new Infragistics.Win.SupportDialogs.FormattedTextEditor.FontDialog();
  2. if (fontDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
  3.     return;
  4. lblCompanyNameSample.Font = fontDialog.Font;

Unfortunately it does not return the font I selected. It keeps returning the default font (Tahoma).

The standard windows FontDialog works as I am imagining (the code above works for that), but I'd prefer to use the infragistics one - it is a little prettier.

Can this be used in this way? And if so, how?

Thanks.

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    The Font property you are looking at here is not the selected font. That's the Font property on Control. In other words, it's like Form.Font - it's the font that the dialog is using to display it's own text.

    The FormattedTextEditor font dialog doesn't return a Windows Font. It's intended for use with the FormattedTextEditor, and so it applies an xml tag to the FormattedTextEditor. It's only intended for use with the FormattedTextEditor's editor dialog. So it can't be used as a replace for the Dotnet Framework's Font dialog.

Reply Children
No Data