kfcalf
kfcalf

Reputation: 35

how to add a click event to item of KryptonContextMenu?

Can anyone explain how to add a click event to an item, the documentation is literally lacking EVERYTHING.

Upvotes: 0

Views: 527

Answers (1)

41686d6564
41686d6564

Reputation: 19651

You can do this in one of two ways:

  1. Using code (just like you'd do with any other event):

    public Form1()
    {
        InitializeComponent();
    
        kryptonContextMenuItem1.Click += KryptonContextMenuItem1_Click;
    }
    
    private void KryptonContextMenuItem1_Click(object sender, EventArgs e)
    {
        // Do something.
    }
    
  2. Using the designer. You can't do by double-clicking the item (like what you'd do with a regular ToolStripMenuItem) because the item isn't exposed to the designer. So, you'll have to go to the Properties window, select the item from the dropdown, click the Events button ⚡, find the event, and double-click that:

    Demo

Upvotes: 1

Related Questions