问题
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