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?




9 Replies

SN Sudharsan Narayanan Syncfusion Team September 2, 2021 11:07 AM UTC

Hi Brent,

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,
 
Sudharsan


ST Stoked September 2, 2021 01:09 PM UTC

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.



SN Sudharsan Narayanan Syncfusion Team September 2, 2021 01:24 PM UTC

Hi Brent,

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); 
            } 
        } 
Sudharsan


ST Stoked replied to Brent Sodtke September 2, 2021 01:25 PM UTC

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.



SN Sudharsan Narayanan Syncfusion Team September 6, 2021 03:40 AM UTC

Hi Brent,

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,
 
Sudharsan


ST Stoked September 6, 2021 01:57 PM UTC

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






TB Thirupathi Bala Krishnan Syncfusion Team September 8, 2021 03:38 AM UTC

Hi Brent,  
 
We have confirmed the reported scenario is a defect and logged a report for the reported scenario “ContextMenu Font style not updated in Office2019Theme”. We’ll provide the patch for the reported issue on September 21st, 2021.  
   
You can track the status of this defect using the following feedback link:     
   
If you have any more specification replication procedure or a scenario to be tested you can add it as a comment in the portal.     
     
Please let us know if you need any further assistance.    
 
Regards,
Thirupathi B. 
 
 



ST Stoked September 22, 2021 02:34 AM UTC

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.



TB Thirupathi Bala Krishnan Syncfusion Team September 22, 2021 05:54 PM UTC

Hi Brent,    
 
Thanks for your patience. 
      
We have fixed the reported issue – “ContextMenu Font style not updated in Office2019Theme”. Please find the patch file from the following location: 


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:              
             
          
NOTE:    
You can change how you receive bug fixes by navigating to the following link and updating your preferences.   
            
Disclaimer:                             
Please note that we have created this patch for the version 19.1.0.63 specifically to resolve the issues reported in this forum #168643. If you have received other patches for the same version for other products, please apply all patches in the order received. This fix will be included in our Volume 3 SP1 release which will be available in November 2021.    
   
Regards,   
Thirupathi B.  
 


Loader.
Up arrow icon