我正在尝试从C#移植以下代码,但不知道!它将如何转换为事件处理程序
C#
Select+=new EventHandler(OnSelectEvent);
if (!isMainMenuItem)
{
OwnerDraw=true;
MeasureItem+=new MeasureItemEventHandler(OnMeasureItem);
DrawItem+=new DrawItemEventHandler(OnDrawItem);
}
移植代码:
[Select] += New EventHandler(AddressOf OnSelectEvent)
If Not isMainMenuItem Then
OwnerDraw = True
' AddHandler Menuitem.select, new measuritemeventhandler(addressof onmeasureitem)
MeasureItem += New MeasureItemEventHandler(AddressOf OnMeasureItem)
DrawItem += New DrawItemEventHandler(AddressOf OnDrawItem)
End If