VB.net覆盖OCX onclick事件



我在程序中使用OCX作为ipcam。当你双击控件时,它会进入全屏模式。我想防止这种情况发生。我的表单中有这个事件。在这一点上,我能做些什么来防止点击事件进入ocx?

Private Sub AxGSViewerX1_ClickSel(sender As Object, e As AxGSViewerXLib._DGSViewerXEvents_ClickSelEvent) Handles AxGSViewerX1.ClickSel
    Console.WriteLine("click")
End Sub

感谢

您可以创建自己的自定义控件,该控件将继承自OCX。然后您可以覆盖事件,例如

Protected Overrides Sub ClickSel(ByVal e As _DGSViewerXEvents_ClickSelEvent)
    'Do nothing here.
End Sub

最新更新