Hi,
I have a static class that creates an UltraMessageBoxManager to display messages. I have set EnableSounds to true, but no sound is produced when the messagebpx is displayed.
using System; using System.Drawing; using System.Windows.Forms; using Infragistics.Win; using Infragistics.Win.UltraMessageBox; namespace Test { internal static class DialogBox { private const Int32 MaximumWidth = 500; private const Int32 MinimumWidth = 400; private static readonly Infragistics.Win.Appearance buttonAppearance = new Infragistics.Win.Appearance(); private static readonly Infragistics.Win.Appearance buttonAreaAppearance = new Infragistics.Win.Appearance(); private static readonly Infragistics.Win.Appearance buttonHotTrackAppearance = new Infragistics.Win.Appearance(); private static readonly Infragistics.Win.Appearance buttonPressedAppearance = new Infragistics.Win.Appearance(); private static readonly Infragistics.Win.Appearance contentAreaAppearance = new Infragistics.Win.Appearance(); private static readonly Infragistics.Win.Appearance footerAppearance = new Infragistics.Win.Appearance(); private static readonly Infragistics.Win.Appearance headerAppearance = new Infragistics.Win.Appearance(); #region Documentation /// <summary> /// Initialize the static appearances. /// </summary> #endregion static DialogBox() { // Set the various appearances buttonAppearance .BackColor = Color.FromArgb(100, 119, 130); buttonAppearance .ForeColor = Color.White; buttonAppearance .ForegroundAlpha = Alpha.Opaque; buttonAreaAppearance .BackColor = Color.White; buttonAreaAppearance .BorderColor = Color.FromArgb(219, 222, 223); buttonAreaAppearance .ForeColor = Color.FromArgb(102, 102, 102); buttonAreaAppearance .ForeColorDisabled = Color.FromArgb(187, 187, 187); buttonHotTrackAppearance.BackColor = Color.FromArgb(66, 84, 94); buttonHotTrackAppearance.BorderAlpha = Alpha.Transparent; buttonHotTrackAppearance.ForeColor = Color.White; buttonPressedAppearance.BackColor = Color.FromArgb(67, 168, 152); buttonPressedAppearance.BorderAlpha = Alpha.Transparent; buttonPressedAppearance.ForeColor = Color.White; contentAreaAppearance .BackColor = Color.White; contentAreaAppearance .BorderColor = Color.FromArgb(219, 222, 223); contentAreaAppearance .ForeColor = Color.FromArgb(102, 102, 102); contentAreaAppearance .ForeColorDisabled = Color.FromArgb(187, 187, 187); contentAreaAppearance .FontData.SizeInPoints = 10; footerAppearance .BackColor = Color.FromArgb(180, 220, 214); footerAppearance .BorderColor = Color.FromArgb( 67, 168, 152); footerAppearance .ForeColor = Color.FromArgb( 85, 85, 85); headerAppearance .BackColor = Color.White; headerAppearance .ForeColor = Color.FromArgb(67, 168, 152); } internal static DialogResult Show(IWin32Window owner, String message, String header, String caption) { DialogResult dialogResult; UltraMessageBoxInfo ultraMessageBoxInfo; UltraMessageBoxManager ultraMessageBoxManager; Cursor.Current = Cursors.Default; ultraMessageBoxManager = new UltraMessageBoxManager { // Set the message box fields MaximumWidth = MaximumWidth , MinimumWidth = MinimumWidth , ButtonAppearance = buttonAppearance , ButtonAreaAppearance = buttonAreaAppearance , ButtonHotTrackAppearance = buttonHotTrackAppearance , ButtonPressedAppearance = buttonPressedAppearance , ContentAreaAppearance = contentAreaAppearance , FooterAppearance = footerAppearance , HeaderAppearance = headerAppearance , UseAppStyling = true , UseFlatMode = DefaultableBoolean.True , UseOsThemes = DefaultableBoolean.False , EnableSounds = DefaultableBoolean.True , Style = MessageBoxStyle.Standard , StartPosition = DialogStartPosition.CenterOwnerForm }; ultraMessageBoxInfo = new UltraMessageBoxInfo { // Set the message box fields Owner = owner , Header = header , Caption = caption , Text = message , Buttons = MessageBoxButtons.OK , Footer = Properties.Resources.ContactSupport }; ultraMessageBoxInfo.ContentAreaAppearance.Image = GetImage(MessageBoxIcon.Error); dialogResult = ultraMessageBoxManager.ShowMessageBox(ultraMessageBoxInfo); ultraMessageBoxManager.Dispose(); ultraMessageBoxInfo .Dispose(); return dialogResult; } private static Image GetImage(MessageBoxIcon icon) { Image image; switch (icon) { case MessageBoxIcon.Error: image = Properties.Resources.button_cancel_32px; break; case MessageBoxIcon.Question: image = Properties.Resources.button_help_32px; break; case MessageBoxIcon.Information: image = Properties.Resources.button_info_32px; break; case MessageBoxIcon.Warning: image = Properties.Resources.warning_32px; break; default: image = null; break; } return image; } } }
Any idea what might be the problem?
Thank You
Hello Tracy,
Thankyou for posting.
I used your code and setup a sample of my own using version 20.2 and I am not able to reproduce the issue.
When the messagebpx display it does make sound. I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if I can provide any further assistance.
Regards,
5086.WindowsFormsApp2.zip
Yes, your test works, but mine doesn't. I have a test project I could send to you.
Thanks,Tracy
Hello,
Thank you for the update. Please provide the test project attach here, or i may create a private case if you want.
Hi Divya,
I found the problem. I was not setting the icon in the UltraMessageBoxInfo properties. This fixed the problem.
Thank You,Tracy