ChartSheetBase.MouseMove Event


Occurs when the position of the mouse pointer changes over the Microsoft.Office.Tools.Excel.ChartSheetBase.

Namespace:   Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

public event ChartEvents_MouseMoveEventHandler MouseMove

The following code example demonstrates a handler for the MouseMove event that displays a message box when the mouse pointer moves over the current Microsoft.Office.Tools.Excel.ChartSheetBase while the primary mouse button is being pressed.

private void DisplayMouseMove()
    Globals.Sheet1.Range["A1", "A5"].Value2 = 22;
    Globals.Sheet1.Range["B1", "B5"].Value2 = 55;

    this.SetSourceData(Globals.Sheet1.Range["A1", "B5"],
    this.ChartType = Excel.XlChartType.xl3DColumn;

    this.MouseMove +=
        new Excel.ChartEvents_MouseMoveEventHandler(

void ChartSheet1_MouseMove(int Button, int Shift, int x, int y)
    if (Button == (int)Excel.XlMouseButton.xlPrimaryButton)
        MessageBox.Show("The mouse is moving over the chart sheet.");
Return to top