开发者

about contextmenustrip

开发者 https://www.devze.com 2023-02-28 22:02 出处:网络
I\'ve added contextmenustrip control at the time of designing of my application. And i want to edit that contxt menu at run time. And i want to add another menu & submenu on that c开发者_如何学编程

I've added contextmenustrip control at the time of designing of my application. And i want to edit that contxt menu at run time. And i want to add another menu & submenu on that c开发者_如何学编程ontext menu. And i want to add handler function for that runtime created menus. Whether is it possible? If possible then provide some documentation.

thanks.


I got an answer of my issue. the sample code used for solving this issue is as follows-

ToolStripMenuItem addContactToGroup = new ToolStripMenuItem();
addContactToGroup.Name = "addContactToGroupToolStripMenuItem";
addContactToGroup.Text = "Add Contact To Group";
addContactToGroup.Click += new System.EventHandler(addContactToGroup_Click);
this.contextMenuStripXtraGrid.Items.AddRange(new ToolStripItem[] { addContactToGroup });
gridControl1.ContextMenuStrip = this.contextMenuStripXtraGrid;

here this means form where contextmenustrip control is inserted.

0

精彩评论

暂无评论...
验证码 换一张
取 消