Reputation: 35
Can anyone explain how to add a click event to an item, the documentation is literally lacking EVERYTHING.
Upvotes: 0
Views: 527
Reputation: 19651
You can do this in one of two ways:
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.
}
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:
Upvotes: 1