下面是我目前如何折叠拆分容器,但我想要一个额外的效果,这样当我折叠容器时它应该慢慢折叠,这样感觉就像动画一样。
我怎样才能用 WinForms 做到这一点?
private void button1_Click(object sender, EventArgs e)
{
Thread backgroundThread = new Thread(
new ThreadStart(() =>
{
if (splitContainer1.InvokeRequired)
{
splitContainer1.Invoke(new MethodInvoker(delegate
{
splitContainer1.Panel1Collapsed = !splitContainer1.Panel1Collapsed;
}));
}
}
));
backgroundThread.Start();
}