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?
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]
Hi Torrey,
This is a great way to style the message box. But I notice a lot of flickering. Is there anyway we can reduce the flickering.
Thanks
Sangeetha
Hmm, I was hoping that "Application Styling" meant "styling the application", not only some parts of it ;-) but OK, I tried your solution.
I inherited my new class from UltraMessageBoxManager and implemented the IUIElementCreationFilter.
This sort of works (thanks so far ;-)) but now my 'normal styled forms' have round edges and my new messagebox has rectangular edges... Any clue?