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
1110
UltraFormManager to style UltraMesssageBoxManager
posted

I'm reviewing the new 2010 infragistics lib because we want to use the UltraFormManager to style our form borders. 

This seems to work OK to style the forms for our applications.

Now we want to use the new UltraMessageBox as well.

How can I get the UltraMessageBoxManager to show in the same form style (and with this I mean the border of the window) in the same way as the rest of my application?

Do I need to set an UltraFormManager for this too? 

Parents
  • 3707
    Verified Answer
    posted

    Technically you're not suppose to because it's a Fixed Dialog and its form members aren't exposed for changes.

    Although, if you're mad scientist (like myself), it's possible to use the Creation Filter to grab the MessageBoxUIElement. From this element you can grab the form's reference and create an instance of WinFormManager to use with the WinMessageBox. Additionally, you'll have to tweak that form's height by roughly an extra 45 pixels to its height because the form manager shrunk it a bit.

    #region IUIElementCreationFilter Members
    public void AfterCreateChildElements(UIElement parent)
    {
        
    }
    public bool BeforeCreateChildElements(UIElement parent)
    {
        if (parent is MessageBoxUIElement)
        {
            if (!wasAdded)
            {
                Form messagebox_form = ((MessageBoxUIElement)parent).Control.Parent as Form;
                UltraFormManager messagebox_manager = new UltraFormManager();
                messagebox_manager.Form = messagebox_form;
                messagebox_form.Height += 40;
                wasAdded = true;
            }
        }
        return false;
    }
    #endregion

    Below I'll paste the url to the documentation that shows how to get the creation filter set up and then you can copy the code from the above snippet to give it a shot.

    http://help.infragistics.com/NetAdvantage/WinForms/2010.3/CLR2.0/?page=Win_Creation_Filter.html

    [Edit - Below is a screen shot of the message box I created with WinFormManager and used the black office 2007 color scheme]

Reply Children
No Data