“System.Runtime.InteropServices.DllImportAttribute”不能应用于“AddHandler”、“RemoveHandler”或“RaiseEvent”方法

更新:2007 年 11 月

将 DllImportAttribute 属性应用于 AddHandler、RemoveHandler 或 RaiseEvent 方法声明。此属性只能用于空的 Function 或 Sub。

**错误 ID:**BC31531

更正此错误

  • 从方法声明中移除 DllImportAttribute 属性。

请参见

参考

Event 语句

AddHandler

RemoveHandler

RaiseEvent

DllImportAttribute