SplitContainer中,做一个固定的面板做一个、面板、SplitContainer

2023-09-05 02:27:37 作者:趁早

我有水平方向的一个SplitContainer的。

I have a splitcontainer with horizontal orientation.

我想要是Panel2一个固定的高度只在形式调整大小,并让分离器调整是Panel2

I want a fixed height for panel2 only during form resize, and let splitter resize panel2

现在我做的这样,但我不能满足,因为用户的通知,该小组调整

Now I'm doing it this way, but I'm not satisfy because user notice that the panel resize

Private Sub Form1_ResizeBegin(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.ResizeBegin 
    spil = SplitContainer1.Height - SplitContainer1.SplitterDistance
End Sub

Private Sub Form1_ResizeEnd(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.ResizeEnd
    SplitContainer1.SplitterDistance = SplitContainer1.Height - spil
End Sub

任何想法?

推荐答案

你试过设置SplitContainer1.FixedPanel = Panel1的(和删除这两个事件)?

Have you tried setting SplitContainer1.FixedPanel = Panel1 (and removing both events) ?