简体   繁体   English

windows forms,如何使用datagridview启动单独的window?

[英]windows forms, how to launch a separate window with 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.提前致谢。

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.禁用表单并将其父级(参见 control.parent)设置为主表单面板。 When the user wants to edit it, set the grid-form parent to nil and enable it.当用户想要编辑它时,将 grid-form parent 设置为 nil 并启用它。

Not actually tried this with WinForms, but it works fine with Delphi VCL so worth a test if no better answers are forthcoming实际上并没有在 WinForms 上尝试过,但它在 Delphi VCL 上运行良好,所以如果没有更好的答案,值得一试

Rgds, Martin Rgds,马丁

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM