We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change the CustomTextFont property of the Popup menu items which gets shown when right click on toolbar area?

 

The text font in the context menu can be changed by getting the CommandBar using GetCommandBarManager method and get hold of DockBarContextMenu. Now the ParentBarItem's BeforePopup event has to handled to change the text font of Popup menu items. Please refer the below code snippet which illustrates this:

C#

this.mainFrameBarManager1.GetCommandBarManager().DockBarContextMenu.ParentBarItem.BeforePopup+=new CancelEventHandler(ParentBarItem_BeforePopup);

private void ParentBarItem_BeforePopup(object sender, CancelEventArgs e)

{

foreach(BarItem baritem in this.mainFrameBarManager1.GetCommandBarManager().DockBarContextMenu.ParentBarItem.Items)

{

baritem.CustomTextFont=new Font("Times New Roman",8.25F);

}

}

VB

AddHandler mainFrameBarManager1.GetCommandBarManager().DockBarContextMenu.ParentBarItem.BeforePopup, AddressOf ParentBarItem_BeforePopup

Private Sub ParentBarItem_BeforePopup(ByVal sender As Object, ByVal e As CancelEventArgs)

For Each baritem As BarItem In Me.mainFrameBarManager1.GetCommandBarManager().DockBarContextMenu.ParentBarItem.Items

baritem.CustomTextFont = New Font("Times New Roman",8.25F)

Next baritem

End Sub

Sample:

http://websamples.syncfusion.com/samples/KB/Tools.Windows/TFont/main.htm

Article ID: Published Date: Last Revised Date: Platform: Control:
1410 04/30/2011 07/10/2014 WinForms XPToolbar
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon