本文介绍了是否可以在C#Windows窗体中创建2 x 2(4个面板)拆分器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建2(行)x 2(列)分离器,它将同时设置4个面板.

I want to create 2(rows) x 2(columns) splitter which will set 4 panels simultaneously.

例如,在MFC中,当我们移动水平&的中心时,垂直分配器同时进行,并相应地设置了4个面板.以前我使用过MFC CSplitterWnd::CreateStatic (4个窗格的4个视图).现在,我已将MFC项目转换为C#,

For example, in MFC as we move center of horizontal & vertical splitter simultaneously, and it set 4 panels accordingly. Previously I had used MFC CSplitterWnd::CreateStatic (4 views for 4 panes). Now I have shifted my MFC Project into C#,

请告知我,因为我想在C#中做同样的事情

Please inform me as I want to do same thing in C#

预先感谢!

推荐答案



然后连接一个垂直的SplitContainer的SplitterMoved事件之一(可能有原因使用SplitterMoving,我不是100%的原因.我会选择SplitterMoved).

Then hook up one of the vertical SplitContainer''s SplitterMoved events (there may be reasons to use SplitterMoving, I''m not 100% on that. I''d go with SplitterMoved). 

在该事件的处理程序中,将OTHER垂直拆分器.SplitterDistance设置为第一个垂直拆分器.SplitterDistance.

Inside the handler for that event, set the OTHER vertical splitter.SplitterDistance to be the first vertical splitter.SplitterDistance.

然后您应该能够使所有4个面板保持同步. 

You should then be able to have all 4 panels stay in sync. 


这篇关于是否可以在C#Windows窗体中创建2 x 2(4个面板)拆分器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 06:03