重写 MenuStrip.Items.Add()?

发布于 2024-12-21 11:45:54 字数 211 浏览 5 评论 0原文

我创建了一个数据库表,其中包含带有自连接的所有菜单,使其像 Level0 -> 1级-> 2级......等在 MenuStrip 中填充这些记录需要大量代码,因此我想将所有这些代码封装在服务器控件上,我想创建一个服务器控件来覆盖方法 MenuStrip.Items.Add() 并将所有代码传输到那里但我似乎找不到它。唯一可以覆盖的是 ToolStripItemCollection,有灵魂吗?

I have create a database tables which holds all the menu with a self join to make it like Level0 -> Level1 -> Level2 .....etc. Populating these records in a MenuStrip required a huge amount of code so i would like to encapsulate all this code on Server Control, i would like to create a server control that overrid the method MenuStrip.Items.Add() and transfer all my code there but i can't seem to find it. The only thing available to override is ToolStripItemCollection, is there Any soultion ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文