在VB.net中,如何在类中添加事件??
我是想写一个基类,在这个基类中添加窗体的keydown、keypress事件,这样其他窗体就不用再写这些事件了,直接继承这个基类就行了,但怎么在类中添加这些事件啊?应该怎么写啊??
[解决办法]
基类窗体代码
Public Class frmBase
Private Sub frmBase_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
End Sub
Private Sub frmBase_KeyPress(sender As Object, e As KeyPressEventArgs) Handles MyBase.KeyPress
End Sub
End Class