)
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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to hook an event for WinForms ScheduleControl context menu?

Platform: WinForms |
Control: ScheduleControl |
Published Date: April 27, 2016 |
Last Revised Date: January 9, 2020

Hook an event for context menu

To hook an event for Schedule Control context menu can be done by item_Click event. When we right click on the context menu strip of schedule control, we can know which item has clicked by using item_Click event.

C#

foreach (MenuItem item in this.scheduleControl1.GetScheduleHost().ContextMenu.MenuItems)
{
    item.Click += item_Click;
}
private void item_Click(object sender, EventArgs e)
{
    MenuItem item = sender as MenuItem;
    MessageBox.Show( item.Text +" Item clicked");
} 

VB

For Each item As MenuItem In    Me.scheduleControl1.GetScheduleHost().ContextMenu.MenuItems
    AddHandler item.Click, AddressOf item_Click
Private Sub item_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim item As MenuItem = TryCast(sender, MenuItem)
    MessageBox.Show(item.Text & "Item clicked")
End Sub

 

Show the hooked event is triggered

Samples:

C#: Click event

VB: Click event

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile
Live Chat Icon