VScrollBar Resizing

时间:2015-08-26 09:30:50

标签: c# winforms autoscroll

I have got a C# WinForms application where a splitterPanel contains a Form;

Form myform = (Form)new CustomFrm();
myform.TopLevel = false;
myform.Dock = DockStyle.Fill;
myform.Show();
splitter.Panel1.Controls.Add(myform);

myform is larger than Panel1 and I'd like the panel autoscroll bars to show. Is this possible even if the Form is not a scrollable controll?

1 个答案:

答案 0 :(得分:0)

  

myform大于Panel1

那只是你设计它的方式。

然后你将[["Aaa","A",new Date(2015,7,26),new Date(2015,10,26)]] 设置为DockStyle,现在,当你做

Fill

对接样式确实会使splitter.Panel1.Controls.Add(myform); 填充 Form;那就是它的Panel现在等于面板的Size

不要将其设置为Clientsize!而只需控制DockStyle.Fill即可设置。