动态地将上下文菜单条附加到复选框列表中
我正在尝试将内置的上下文菜单条附加到插入到我的 CheckBoxList 中的对象中 我想做的是将 contextMenuStrip 附加到在我的 checkboxList 中创建的新复选框中,这样当我按下鼠标右键时,菜单就会出现 例如:
CheckedListBox cbllist = new CheckedListBox ();
cbllist.add(object);
现在在我的列表中我有一个包含我的对象的新复选框 我如何将 contextMenuStrip 附加到它?
预先感谢您的帮助。
i am trying to attach a built context menu strip into an object which i insert into my CheckBoxList
what i am trying to do is to attach the contextMenuStrip into the new checkbox that is being created inside my checkboxList so when i press on the right click of the mouse the menu will appear
for example :
CheckedListBox cbllist = new CheckedListBox ();
cbllist.add(object);
now inside my list i have a new checkbox that contains my object
how do i attach the contextMenuStrip to it?
thanks in advance for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,上下文菜单条应该位于所有选中的列表框中,每次我从列表中删除一个对象时,都需要将 null 放入 cbllist.contextmenustrip 中
每次选择对象时,上下文菜单条都应插入到 cbllist.contextmenustrip
okey the contextmenu strip should be on the all checkedlistbox and each time i remove an object from the list there is a need to put null inside the cbllist.contextmenustrip
each time an object is being selected the contextmenu strip should be inserted to the cbllist.contextmenustrip