VB.net覆盖OCX onclick事件

时间:2013-07-17 21:06:45

标签: vb.net ocx

我在程序中使用OCX作为ipcam。双击控件时,它进入全屏模式。我想阻止这个。我的表格中有此活动。我现在有什么可以做的,以防止点击事件进入ocx?

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

End Sub

感谢

1 个答案:

答案 0 :(得分:0)

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

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