在运行时更改SplitContainer(Panel2)的高度. [英] Change SplitContainer (Panel2) height at runtime.

查看:1252
本文介绍了在运行时更改SplitContainer(Panel2)的高度.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那里

是指能够在正确的方向上指向或具有可在运行时更改splitcontainer中的面板大小的代码段的人.我目前有一个拆分容器,其水平方向设置为2个面板.在其中一个面板中,用户可以按下一个按钮,该按钮会更改panel2的高度,从而使其消失.

我尝试使用以下代码,但收到错误消息无法显式设置SplitterPanel的高度.请改为在SplitContainer上设置SplitterDistance."

Hi There

is anyone able to point in the right direction or have snippet of code that can change the size of panel in splitcontainer at runtime. i currently have a split container set to horizonatal orientation with 2 panels. In one of the panels there a button that the users press which changes the height of panel2 so it has disappeared.

im try with the code below but getting error message "The SplitterPanel''s height cannot be set explicitly. Set the SplitterDistance on the SplitContainer instead."

 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

    SplitContainer2.Panel2.Height = 2

End Sub



任何帮助都将适用.

谢谢IN advance



Any Help be appericated.

thanks IN advance

推荐答案


试试这个:
Hi,
try this:
Me.SplitContainer2.SplitterDistance = Me.SplitContainer2.Width - Me.SplitContainer2.SplitterWidth


以及如何将其恢复为原始状态/大小
and how doo u revert it back to it orginal state/size


这篇关于在运行时更改SplitContainer(Panel2)的高度.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆