N
notnoname
Unregistered / Unconfirmed
GUEST, unregistred user!
我想在StringGrid的右键菜单上动态添加一个新的item,我的代码如下
var NewItem:TMenuItem;
begin
NewItem:TMenuItem.Create(StringGrid.PopupMenu);
NewItem.Caption := 'Menu Item ';
NewItem.OnClick := PopupMenuItemsClick;// assign it an event handler
StringGrid.PopupMenu.Items.Add(NewItem);
end;
运行时出错,我改怎么办?
var NewItem:TMenuItem;
begin
NewItem:TMenuItem.Create(StringGrid.PopupMenu);
NewItem.Caption := 'Menu Item ';
NewItem.OnClick := PopupMenuItemsClick;// assign it an event handler
StringGrid.PopupMenu.Items.Add(NewItem);
end;
运行时出错,我改怎么办?