事件及範例
RightClickOccurred 事件
RightClickOccurred 事件// subscribing to the RightClickOccurred event with the correct event handler
strucForm.RightClickOccurred += strucForm_RightClickOccurred;// have the correct method signature that matches the EventHandler<RightClickEventArgs> delegate
private void strucForm_RightClickOccurred(object sender, RightClickEventArgs e)
{
// Your event handling code here
// Access the location information
Point location= e.MouseLocation;
// Show the context menu at the mouse click location
contextMenuStrip.Show(strucForm, location);
}
// right click event
strucForm.RightClickOccurred += (sender, args) =>
{
Console.WriteLine("OnRightClickOccurred from program...");
Point Location= args.MouseLocation;
// Show the context menu at the mouse click location
contextMenuStrip.Show(strucForm, Location);
};OnDataSaved 事件
OnDataSaved 事件定義
宣告方式
工作流程
範例用途
訂閱範例
Last updated