When using the XtraWizard control (in Aero style, not Wizard97 style), if the Windows Title bar text font has been set to a font that does not support the "Regular" style, an unhandled exception (crash) occurs.
The example font I found this issue with was "Monotype Corsiva," a font that is included with Microsoft Office.
The problem only occurs if you customize your Windows appearance and change the default font for either the "Active Title Bar" or "Inactive Title Bar" to something like the "Monotype Corsiva" font.
The problem does not occur if the XtraWizard is using Wizard97 style; it only occurs if using Aero style.
I have attached a screenshot of the settings you need to change to produce the error, along with a picture of the error itself.
I reproduced this error using Windows Vista, but I presume it would manifest itself on any version of Windows, as long as the same font setting was chosen.
Steps to Reproduce:
- Create a new blank Windows Application project and drag the XtraWizard control onto the default form (Form1).
- Set the XtraWizard's WizardStyle property to WizardAero.
- Change the default Windows system font for the "Active Title Bar" (or "Inactive Title Bar") to a font that does not support "Regular" style. (For example, choose the font "Monotype Corsiva".)
- Attempt to launch the application.
Actual Results:
An unhandled exception occurs with the following details:
************** Exception Text **************
System.ArgumentException: Font 'Monotype Corsiva' does not support style 'Regular'.
at System.Drawing.Font.CreateNativeFont()
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font…ctor(FontFamily family, Single emSize, FontStyle style)
at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetAppearanceDefault()
at DevExpress.XtraWizard.WizardViewInfo.UpdatePaintAppearance()
at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetHeaderTitleBounds(BaseWizardPage page)
at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetInteriorPageBounds(BaseWizardPage page)
at DevExpress.XtraWizard.WizardViewInfo.GetPageBounds(BaseWizardPage page)
at DevExpress.XtraWizard.WizardViewInfo.UpdatePagesBounds()
at DevExpress.XtraWizard.WizardControl.LayoutChanged()
at DevExpress.XtraWizard.WizardControl.OnResize(EventArgs e)
at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Control.UpdateBounds()
at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Expected Results:
The app launches with the Wizard using the system font.
I think this problem is still present, or possibly has regressed since it was fixed.
Application built with v2011 vol 1.4 (latest release as of this date) still encounters this problem. Operating System is Windows XP.
Again, this only applies to forms using the XtraWizard control.
Here is the exception that was thrown, along with some extra debug info that my app happened to include:
OS: Microsoft Windows XP Professional (Win32NT 5.1.2600.196608)
Program Version: 2.8.1.37
Exception Source: System.Drawing
Exception Type: System.ArgumentException
Exception Message: Font 'Monotype Corsiva' does not support style 'Regular'.
Exception Target Site: CreateNativeFont
Exception Stack Trace: at System.Drawing.Font.CreateNativeFont()
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font…ctor(FontFamily family, Single emSize)
at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetAppearanceDefault()
at DevExpress.XtraWizard.WizardViewInfo.UpdatePaintAppearance()
at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetHeaderTitleBounds(BaseWizardPage page)
at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetInteriorPageBounds(BaseWizardPage page)
at DevExpress.XtraWizard.WizardViewInfo.GetPageBounds(BaseWizardPage page)
at DevExpress.XtraWizard.WizardViewInfo.UpdatePagesBounds()
at DevExpress.XtraWizard.WizardControl.LayoutChanged()
at DevExpress.XtraWizard.WizardControl.OnLoaded()
at DevExpress.XtraWizard.WizardControl.OnBeforePaint()
at DevExpress.XtraWizard.WizardControl.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam
The steps to reproduce are the same as before - set the Active Title Bar font in Windows to any font that does not have a "normal" style (e.g., Monotype Corsiva) and then open an app that displays a form with an XtraWizard. The error will then occur.
Hi Keith ,
I have reproduced the problem.
Our developers will research this issue and try to fix the problem as soon as possible.
Thanks
Dimitros