I'm experiencing a new appearance for our mainstream application and I'm using hard current AppStylist for Windows Forms v12.1 (12.1.20121.1001).
I attacked this rocky mountain loading one of the preset styles, basically the Office2010Silver style.
Loading the style at runtime isn't a problem: it runs finely from embedded resource and from external file too.
In order to complete my style file and having it ready for the application release, I'm facing some minor issues I would like to fix as soon as possible. I list them below:
DASHED MENU ITEM SEPARATORS
Menu item separators are dashed and it's a bit disappointing for our staff. I noticed that there's no matching bitmap to for that fashed separator and I have no idea where searching for.
NAVIGATOR DIALOG HIGHLIGHTED ITEM
I managed also the UI Role NavigatorDialog, but no luck to change the background color of the highlighted window item. It seems having the same background color of the navigator dialog background. However if you move the mouse over the window items in the dialog, the item hovered by the mouse is coloured with an appropriate background.
FLOATING TOOLBAR BORDER COLOR
I can't find also the floating toolbar border color in the UI Roles. Where is it?
Thank you again for your help.
I pushed a step forward getting the same appearance of the selected item in the NavigatorDialog with this code:
Private Sub ForceNavigatorSettingsSelectedItemAppearance()
Dim appearanceData As Infragistics.Win.AppearanceData
Dim requestedProps As Infragistics.Win.AppearancePropFlags
Dim firstTool As PopupToolBase = Nothing
For Each tool As ToolBase In Me.UltraToolbarsManager.Tools
If (TypeOf tool Is Infragistics.Win.UltraWinToolbars.PopupMenuTool) Then
firstTool = DirectCast(tool, PopupToolBase)
Exit For
End If
Next
If (Not firstTool Is Nothing) Then
appearanceData = New Infragistics.Win.AppearanceData()
requestedProps = Infragistics.Win.AppearancePropFlags.AllRender
firstTool.ResolveAppearance(appearanceData, requestedProps, True, False)
Me.UltraDockManager.NavigatorSettings.SelectedItemAppearance = New Infragistics.Win.Appearance(appearanceData)
End Sub
Hello,
You could change back color of selected item of NavigatorDialor, if you adjust ultraDockManager1.NavigatorSettings.SelectedItemAppearance object. Please see attached sample.
Please let me know if you have any further questions
Thank you for your answer.
And what about the issue of the backcolor of PopupToolUIElement shown in the NavigatorDialog? At now some styles available in your examples have wrong background colors when highlighted in the Navigator Dialog with CTRL-TAB shortcut.I mean the styles in this folder:C:\Users\Public\Documents\Infragistics\NetAdvantage 2012.1\Windows Forms\AppStylist for Windows Forms\Styles\
Hello ,
The style (i.e. solid vs dashed) of the MenuItemSeparator is based off of the UltraToolbarsManager’s resolved Style (ToolbarStyle). So you could use DrawFilter in order to change the style of MenuItemSeparator. The other separator, which you mentioned is actually is GrabHangler and you could modify it setting this.ultraToolbarsManager1.ToolbarSettings.GrabHandleStyle
To change the color of the FloatingToolbarBorder is to use a DrawFilter to resolve the BackColor of the FloatingToolbarCaption UIRole, and assign it to the drawParams.AppearanceData.
#region IUIElementDrawFilter Members
public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
{
if (drawParams.Element is FloatingToolbarUIElement)
AppearancePropFlags flags = AppearancePropFlags.BackColor;
AppearanceData data = new AppearanceData();
UIRole role = this.ultraToolbarsManager1.ComponentRole.GetRole(134);
role.ResolveAppearance(ref data, ref flags, RoleState.Normal);
if (data.HasPropertyBeenSet(AppearancePropFlags.BackColor))
drawParams.AppearanceData.BackColor = data.BackColor;
}
return false;
public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams)
return DrawPhase.BeforeDrawBackColor;
return DrawPhase.None;
#endregion
I have implemented this suggestions in a small sample, please run the sample and let me know if this is what you are looking for.
Please let me know if you have any further questions.
I worked out how to override the dashed menu item separator with a Custom Draw Filter. I'm going to use the same workaround even with the other issues:
Public Function GetPhasesToFilter(ByRef drawParams As Infragistics.Win.UIElementDrawParams) As Infragistics.Win.DrawPhase _ Implements Infragistics.Win.IUIElementDrawFilter.GetPhasesToFilter If (TypeOf (drawParams.Element) Is PopupMenuSeparatorItemUIElement) Then Return DrawPhase.AfterDrawElement End If Return Infragistics.Win.DrawPhase.None End Function Public Function DrawElement(ByVal drawPhase As Infragistics.Win.DrawPhase, _ ByRef drawParams As Infragistics.Win.UIElementDrawParams) As Boolean _ Implements Infragistics.Win.IUIElementDrawFilter.DrawElement If (drawParams.Element Is Nothing) Then Return False If (TypeOf (drawParams.Element) Is PopupMenuSeparatorItemUIElement) Then Return DrawPopupMenuItemSeparator(drawPhase, drawParams) End If Return False End Function