Excel VSTO chart.mouseup event not firing

喜你入骨 提交于 2020-01-17 10:19:09

问题


I am creating an application level addin for Excel using Excel Interop. Here is my setup:

Dim NativeSheet as Worksheet = Globals.ThisAddIn.Application.ActiveSheet
Dim vstoSheet as Worksheet = Globals.Factory.GetVstoObject(NativeSheet)
Dim vstoChart as Chart = vstoSheet.Controls.AddChart(left:=50, top:=50, width:=50, height:=50, name:="Membrane")

I then add three event handlers: for MouseDown, MouseMove and MouseUp.

Private Sub _vstoChart_MouseUp(Button As Integer, Shift As Integer, x As Integer, y As Integer) Handles _vstoChart.MouseUp
    System.Diagnostics.Debug.Print("Up")
End Sub

Private Sub _vstoChart_MouseDown(Button As Integer, Shift As Integer, x As Integer, y As Integer) Handles _vstoChart.MouseDown
    System.Diagnostics.Debug.Print("Down")
End Sub

Private Sub _vstoChart_MouseMove(Button As Integer, Shift As Integer, x As Integer, y As Integer) Handles _vstoChart.MouseMove
    System.Diagnostics.Debug.Print("Move")
End Sub

The trouble is, it works for MouseDown and MouseMove, but the MouseUp event doesn't seem to be firing.

来源:https://stackoverflow.com/questions/38682113/excel-vsto-chart-mouseup-event-not-firing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!