显示 ContextMenuStrip 后清除项目

发布于 2024-09-10 06:36:10 字数 182 浏览 0 评论 0原文

我想在 ContextMenuStrip 显示后立即清除这些项目。但是,当我进行以下调用时,ContextMenuStrip 一开始就没有正确显示。有什么想法吗?

ContextMenuStrip.Show()
ContextMenuStrip.Items.Clear();

谢谢,

I wanted to clear the items just after the ContextMenuStrip is shown. However when I was making the following calls, ContextMenuStrip didn't show properly in the first place. Any ideas?

ContextMenuStrip.Show()
ContextMenuStrip.Items.Clear();

Thanks,

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

万水千山粽是情ミ 2024-09-17 06:36:10

请忽略此线程。

我应该处理 ContextMenuStrip.Closing 事件并将 ContextMenuStrip.Items.Clear() 放在里面来完成这项工作。

谢谢,

Please disregard this thread.

I should handle ContextMenuStrip.Closing event and put ContextMenuStrip.Items.Clear() inside to do the job.

Thanks,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文