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?
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
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.