Hello,
I'm attempting to change the color of the mouseover hover color for menu items within the context menu of the the TabbedGroupMDIManager. I have referenced the link below on appearance settings, but nothing is listed there. I was hoping someone could assist. Also, I'm using the Office2019Colorful theme if that matters.
https://help.syncfusion.com/windowsforms/tabbedmdi/appearance-settings
I originally thought that changing the "ContextMenuItem.MetroColor" property would do the trick, but it does not.
I've also looked into properties of BarItems within the TabbedGroupedMDIManager BeforeDropDownPopup event, but nothing seem relevant here either.
Looking for some assistance.
Thanks.
# Form1.cs
private void tabbedMDIManager_TabControlAdded(object sender, TabbedMDITabControlEventArgs args)
{
PropertyInfo propertyInfo = this.tabbedGroupedMDIManager1.GetType().BaseType.GetProperty("ContextMenu", BindingFlags.NonPublic | BindingFlags.Instance);
if (propertyInfo != null)
{
object obj = propertyInfo.GetValue(this.tabbedGroupedMDIManager1);
(obj as PopupMenu).ThemeStyle.BarItemStyle.HoverBackColor = Color.Yellow;
propertyInfo.SetValue(this.tabbedGroupedMDIManager1, obj, null);
}
}
private void DockingManager1_DockContextMenu(object sender, DockContextMenuEventArgs arg)
{
arg.ContextMenu.ThemeStyle.BarItemStyle.HoverBackColor = Color.Aqua;
}
|
Hello.
While the example was helpful, I now have another similar issue regarding context menu's with the TabbedGroupedMDIManager. I've included a screen capture below.
While the code previously provided changes the background color for the context menu when right-clicking on the tab, how can the background color be changed for the DropDownButton shown?
I cannot seem to find a property to modify for this ability (or perhaps overlooked it). Please guide me in the right direction to accomplish this latest ask.
Thank you.
# Form1.cs
public Form1()
{
InitializeComponent();
SkinManager.LoadAssembly(typeof(Office2019Theme).Assembly);
dockingManager1.ThemeName = "Office2019Colorful";
tabbedGroupedMDIManager1.ThemeName = "Office2019Colorful";
tabbedGroupedMDIManager1.CloseButtonVisible = true;
tabbedGroupedMDIManager1.DropDownButtonVisible = true;
AddItems();
tabbedGroupedMDIManager1.BeforeDropDownPopup += TabbedGroupedMDIManager1_BeforeDropDownPopup;
}
private void TabbedGroupedMDIManager1_BeforeDropDownPopup(object sender, DropDownPopupEventArgs e)
{
MDITabPanel panel = tabbedGroupedMDIManager1.TabGroupHosts[0].MDITabPanel;
FieldInfo fieldInfo = panel.GetType().GetField("m_pmDropDownPopup", BindingFlags.NonPublic | BindingFlags.Instance);
if (fieldInfo != null)
{
object obj = fieldInfo.GetValue(panel);
(obj as PopupMenu).ThemeStyle.BarItemStyle.HoverBackColor = Color.Yellow;
fieldInfo.SetValue(panel, obj);
}
} |
Excellent. All provided solutions work as expected. Much appreciated.