问题描述
我的WinForm应用程序中有2个PropertyGrid控件。它们是为了并排比较两个对象,所以我想要
做的是在用户与UI交互时同步它们。例如,如果用户在PropertyGridControl旁边调整PropertyGrid或GridSplitter的大小,我希望第二个PropertyGridControl也调整大小。如果用户在其中一个
PropertyGridControls中选择一行(选择一个路径),则另一个PropertyGridControl也会被选中。此外,如果滚动条在一个PropertyGridControl内移动,另一个将自动滚动到相同的位置。如果一个PropertyGrid的类别扩展/折叠
,其他也应该展开/折叠。
你对如何处理这个问题有什么建议吗?
任何例子都很受欢迎。
Hi,
I have 2 PropertyGrid controls in my WinForm app. They are meant to compare two objects side by side, so what I want to do is to sync these as the user interacts with the UI. For example, if the user resizes the PropertyGrid or the GridSplitter next to the PropertyGridControl, I'd like the second PropertyGridControl to also resize. If the users selects a row in one of the PropertyGridControls (selects a path), the other PropertyGridControl gets selected too. Also if the scroll bar is moved inside one PropertyGridControl, the other will auto scroll to the same position. And if the one PropertyGrid's category expands/collapses other should also expand/collapse.
Do you have a suggestion on how to approach this?
Any examples are appreciated.
这篇关于两个PropertyGrids控制同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!