private void Mouse_Click(object sender, MouseEventArgs e) { int x = e.X; int y = e.Y; Console.WriteLine("Mouse Clicked at X: {0}, Y: {1}", x, y); }
private void Mouse_Wheel(object sender, MouseEventArgs e) { int delta = e.Delta; Console.WriteLine("Mouse Wheel Scrolled {0} units", delta); }This example demonstrates how to handle the mouse wheel event and get the amount of scrolling by retrieving the delta value. The MouseEventArgs class is part of the System.Windows.Forms package/library, which provides UI controls and services for Windows Forms-based applications.