context menu font style
Community, I'm not 100% sure if this pertains to the TabbedGroupedMDIManager or the DockingManager controls, but I have the need to change the font for the context menu that appears, as shown in the attached image.
Any one have any thoughts on where I can do this?
Thanks for contacting syncfusion Support,
We have checked the reported issue that “ContextMenu Style” from our end. We have prepared the sample to achieve the requirement. Please find the sample and code snippet from the below,
Code snippet:
DockingManager ContextMenu font style:
|
dockingManager1.DockContextMenu += DockingManager1_DockContextMenu;
private void DockingManager1_DockContextMenu(object sender, DockContextMenuEventArgs arg) {
foreach (BarItem item in arg.ContextMenu.ParentBarItem.Items)
{
item.CustomTextFont = new Font("Broadway", 12);
}
} |
TabbedMDIManager font style:
|
this.tabbedMDIManager.TabControlAdded += new TabbedMDITabControlEventHandler(tabbedMDIManager_TabControlAdded);
private void tabbedMDIManager_TabControlAdded(object sender, TabbedMDITabControlEventArgs args) {
foreach (BarItem item in tabbedMDIManager.ContextMenuItem.Items)
{
item.CustomTextFont = new Font("Cooper Black", 12);
}
} |
Sample: https://www.syncfusion.com/downloads/support/forum/168524/ze/CustomFontStyle240521349
Please try with the above solution and let me know your concerns. We are happy to assist you.
Regards,
Unfortunately neither of those blocks of code do anything for my project.
Additionally, when right-clicking on the caption of a dock, the 'dockcontextmenu' event fires and an exception is thrown:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
My original ask was for the context menu when windows are docked as tabs. I'm using the TabbedGroupedMDIManager, but the provided code is for a control of type TabbedMDIManager. I do know that these controls are similar, so I tried the code provided within the TabControlAdded event for the TabbedGroupedMDIManager, but that didn't work either.
However, the provided example IS doing what I would expect. So I'm going to have to revisit my code and compare.
Thank you.
We have prepared the sample in TabbedGroupedMDI to achieve the requirement. Please find the sample, Video, and code snippet from the below,
Code Snippet:
|
Tabbed.TabControlAdded += TabbedGroupedMDIManager1_TabControlAdded;
private void TabbedGroupedMDIManager1_TabControlAdded(object sender, TabbedMDITabControlEventArgs args) {
foreach (BarItem item in Tabbed.ContextMenuItem.Items)
{
item.CustomTextFont = new Font("Broadway", 12);
}
} |
Sample: https://www.syncfusion.com/downloads/support/forum/168524/ze/TabbedGroupedMDI73866181
Video: https://www.syncfusion.com/downloads/support/forum/168524/ze/ContextMenu_In_TabbedGroupedMDI1718547656
Please try with the above solution and let me know your concerns. We are happy to assist you.
Regards,
I just noticed that the provided example is working as expected, because the TabbedGroupedMDIManager form is distinct from the DockingManager form.
In my project, I'm using both controls simultaneously on the same form.
Can you provide an example using both controls in the same form with the original requirements of changing the font?
Thanks.
We have prepared the sample with the TabbedGroupedMDI and Docking Manager control with your requirement of changing font style in ContextMenu. Please check the sample from the below location.
Sample: https://www.syncfusion.com/downloads/support/forum/168524/ze/DockingManager_TabbedGroupedMDI-251191841
Please check with the sample and let me know your concerns.
Regards,
Support, this is not working with the Office2019Colorful theme and appears to be a bug. See attached screenshots. I used your most recent provided example and just added the theme to the components. The issue shown is what I'm experiencing. For consistency through the application, the Office2019Colorful theme is to be used.
Where do I go from here? This appears to be a bug with the theme
Thirupathi B.
Support,
I'm following up on this defect as it was noted that a patch would be provided. Can you please provide an update?
Thanks.
V19.1.0.63
|
Recommended approach – exe will perform automatic configuration
Please find the patch setup here:
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment
Please find the patch assemblies alone from:
Please find the Nugets from the below location:
|
- 9 Replies
- 3 Participants
-
ST Stoked
- Sep 1, 2021 12:32 PM UTC
- Sep 22, 2021 05:54 PM UTC