windows窗体,如何使用datagridview启动单独的窗口?
我有一些数据可以显示在面板上附加的网格上。当用户单击某个按钮时,我将显示此面板。现在我想在一个单独的窗口中启动这个网格(应该是现有窗口的子窗口)并希望使网格可编辑,单击控件...等,这可能吗?
提前致谢。
I've some data that can be shown on grid attached on a panel. When user clicks some button i'm showing this panel. Now i wanted to launch this grid in a separate window(should be a child to existing window) and want to make the grid editable, click controls...etc, is it possible?
thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够通过将网格放置在单独的表单上并完成编辑内容来实现此效果。禁用该窗体并将其父窗体(请参阅 control.parent)设置为主窗体面板。当用户想要编辑它时,将 grid-form 父级设置为 nil 并启用它。
实际上并没有用 WinForms 尝试过这个,但它与 Delphi VCL 一起工作得很好,所以如果没有更好的答案即将到来,值得一试
Rgds,
马丁
You should be able to achieve this effect by placing your grid on a separate form, complete with editing stuff. Disable the form and set its parent, (see control.parent), to be the main form panel. When the user wants to edit it, set the grid-form parent to nil and enable it.
Not actually tried this with WinForms, but it works fine with Delphi VCL so worth a test if no better answers are forthcoming
Rgds,
Martin