I have about 20 modal dialogs and no dialog displays another dialog so there is never more than one displayed at a time.
I would like to create a single UltraFormManager to handle all these dialogs (only 1 at a time) by assigning the current dialog to the FormMgr.Form property.
eg. Create the dialog assign it to the Form property Display the dialog using ShowModal()
I tried this by defining an UltraFormManager on my MDI form - but NOT assigning its Form property to the current form. (I can not use it with the MDI form because that already has a DockManager which I read would be a conflict.)
I then use the code indicated above and it 'almost' did what I wanted.It displayed the new caption and border - but within the dialog's client area instead of on top of the Caption/frame.
Every dialog already has a panel that uses Dock Fill (as required by the FormMgr) so I thought it would be able to figure out the increased size and position changes.
Did I miss a step, or is this simply not possible?
ThankMike
The following appears to work correctly. It requires a few odd things to be done in a very specific order but it does work.
Create a 'common' FormManager (in your main form) using code.
Add the properties: Friend FormMgr = New Infragistics.Win.UltraWinForm.UltraFormManager() Private Dock_Area_Left = New Infragistics.Win.UltraWinForm.UltraFormDockArea Private Dock_Area_Right = New Infragistics.Win.UltraWinForm.UltraFormDockArea Private Dock_Area_Top = New Infragistics.Win.UltraWinForm.UltraFormDockArea Private Dock_Area_Bottom = New Infragistics.Win.UltraWinForm.UltraFormDockArea
and initialize them in Form_Load: Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinForm.DockedPosition.Left Dock_Area_Left.FormManager = Me.FormMgr Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinForm.DockedPosition.Right Dock_Area_Right.FormManager = Me.FormMgr Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinForm.DockedPosition.Top Dock_Area_Top.FormManager = Me.FormMgr Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinForm.DockedPosition.Bottom Dock_Area_Bottom.FormManager = Me.FormMgr
For each modal dialog: Set the FormBorderStyle to FixedDialog or Sizeable (in the Designer) Add a Panel with Dock=Fill if you do not already have one. If the border is FixedDialog make the panel/form 8 pixels wider and 33 pixels higher than it used to be. (allows for the frame and caption) Add the following 2 lines to the Form_Activate event handler: MainForm.FormMgr.Form = Me Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Note - If you initially define the dialog with FormBorderStyle=None then the Close button on caption will not work.
This method is a whole lot easier than adding 50 LOC to every Designer file and an additional 75 LOC in the associated resx file (if your app is localizable)
The only remaining problem is those Forms that already have an UltraToolbar control.
If the toolbar is not moveable or customizable it seems that the Dock areas it defines are redundent ... so maybe a Form Manager can be forved to work there also.
If anyone gets that to work please add the required info to this thread.
ThanksMike
Hello Mike,
Since UltraFormManger and UltraToolbarsManager are not working together, I can suggest you to make an exceptions for the form which content a UltraToolbarsManager and try to use it without a UltraFormManger.
What exactly you are trying to achieve.
Let me know if you have any further questions.
Sincerely,
Hristo
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
I am trying to use the FormManager to to allow me to style all the forms in my application.It looks a bit odd to have the MDI parent looking different from the children and dialogs.
I have found that I can do this by creating a FormManager in each of the MDI child forms and then by adding one line of code to each dialog. That line simply calls the following function (defined in my MDI Form's code file) and passes 'Me' as the parameter.
This works for all of my own forms (except the MDI parent) but not for such things as the common dialogs or the builtin Infragistics dialogs (Customize, etc)
The problem with the MDI parent is that the status bar is drawn on top of the bottom frame, and does not have the expected sizing handle. (I did not try to define the FormManager via the designer since that form also has a ToolbarManager. However another form with a toolbarManager works fine when I call the following function to add a FormManager to it)
Friend Sub SetDialogManager(ByVal dlg As Form) 'Create a FormManager for the specified dialog If dlg.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedDialog Then _ dlg.Size = New Size(dlg.Width + 8, dlg.Height + 33) dlg.ShowIcon = False dlg.FormBorderStyle = Windows.Forms.FormBorderStyle.None FormMgr = New Infragistics.Win.UltraWinForm.UltraFormManager Dock_Area_Left = New Infragistics.Win.UltraWinForm.UltraFormDockArea Dock_Area_Right = New Infragistics.Win.UltraWinForm.UltraFormDockArea Dock_Area_Top = New Infragistics.Win.UltraWinForm.UltraFormDockArea Dock_Area_Bottom = New Infragistics.Win.UltraWinForm.UltraFormDockArea FormMgr.Form = dlg Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinForm.DockedPosition.Left Dock_Area_Left.FormManager = Me.FormMgr Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinForm.DockedPosition.Right Dock_Area_Right.FormManager = Me.FormMgr Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinForm.DockedPosition.Top Dock_Area_Top.FormManager = Me.FormMgr Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinForm.DockedPosition.Bottom Dock_Area_Bottom.FormManager = Me.FormMgr End Sub
One thing I have found is that when I upgraded to NetAdvantage 10.3 all the form captions became centered. That looks like a bug to me. Form captions are normally Left justified so that should be the default ... and it was the default in 10.2.
This can easily be fixed by adding a line to specifically set the TextHAlign property either to the code (above) or to the isl files.
Mike
UltraToolbarsManager allow you to style the form just like UltraFormManager. Please look at UltraToolbarsManager.Ribbon see the CaptionAreaAppearance and the CaptionAreaActiveAppearance properties. About the behavior in 10.3 I have created a case for you with ID CAS-53762-03H60T. So I will contact you via the case.
Thank you.
I assume the Ribbon caption area only applies if you are using the ribbon.
I use the standard toolbars (the ribbon is a big step backwards in my opinion - no customization available) and setting those properties had no effect.
Since the docs say FormManager and ToolbarManager are not both supported I was not expecting a fix for this. The strange thing is that by using code similar to my function (above) within the Form_Load event I can apply styles to the caption and Right/Left frame. The only problem is the bottom frame which is either hidden below the status bar or simply not displayed at all.This makes it impossible to resize the form by dragging the bottom edge so I do not want to implement that. (and the sizing handle on the status bar also disapears.)
Unless you know of a way around the hidden bottom frame I think we can say that the question is answered as well as it can be.