CommandEventArgs is a class in C# that is primarily used to obtain information about the event that triggered a command. It is used to pass event handling arguments for the Command event of a control, including the event information for command source controls such as Menu and MenuItem. The CommandEventArgs class is typically used with controls that use the command model, such as the Button, Menu, and MenuItem controls in Windows Forms.
Examples:
1. Button click event
private void button1_Click(object sender, CommandEventArgs e) { // do something when the button is clicked }
2. Menu item click event
private void menuItem_Click(object sender, CommandEventArgs e) { // do something when the menu item is clicked }
Package/Library:
This class is part of the System.Web.UI.WebControls namespace.
C# (CSharp) CommandEventArgs - 60 examples found. These are the top rated real world C# (CSharp) examples of CommandEventArgs extracted from open source projects. You can rate examples to help us improve the quality of examples.