Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
896
Context Menu Toggle
posted

Hi,

I am using optionmenuopening event o add the additional context menu, it is coming perfectly but i want to make it as toggle one. The one in exampe coming with tick mark. What style i need to apply and how to enable and disable the tick mark based on the selection made ?

Here with i am attaching sample code to add a new context menu into the context menu

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Private Sub ContentPane_OptionsMenuOpening(ByVal sender As Object, ByVal e As

Infragistics.Windows.DockManager.Events.PaneOptionsMenuOpeningEventArgs)

 

 

Dim contentPane As ContentPane = TryCast

(e.Source, ContentPane)

 

 

If contentPane Is Nothing

Then

 

 

Exit

Sub

 

 

End

If

 

 

'Seperator

 

 

Dim separatorItem As New

Separator

separatorItem.SetResourceReference(StyleProperty, Infragistics.Windows.DockManager.XamDockManager.MenuItemSeparatorStyleKey)

e.Items.Add(separatorItem)

 

 

'Set Default Menu

 

 

Dim menuItem As New

MenuItem()

menuItem.Header =

 

"Set as Default"

menuItem.Tag =

 

"SetasDefault"

menuItem.ToolTip =

 

"Set's the Current window as user default"

 

 

AddHandler menuItem.Click, AddressOf

SetAsDefault_Click

menuItem.SetResourceReference(StyleProperty, Infragistics.Windows.DockManager.XamDockManager.MenuItemStyleKey)

e.Items.Add(menuItem)

 

 

End

Sub

Thanks in advance

Abhi