C#Winform Sliding SplitContainer [英] C# Winform Sliding SplitContainer

查看:110
本文介绍了C#Winform Sliding SplitContainer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有一种方法可以使用拆分容器进行winform,您可以通过单击按钮滑出。我不想花费在昂贵的UI控件或工具箱上购买许可证。

I was wondering if there was a way to have a winform with split container that you can slide out by click of a button. I do not want to spend to purchase license on expensive UI controls or a toolbox.

推荐答案

为什么购买任何东西,如果你有两个控件可供选择?请参阅 System.Windows.Forms.Splitter System.Windows.Forms.SplitContainer

http://msdn.microsoft。 com / en-us / library / system.windows.forms.splitcontainer%28v = vs.110%29.aspx [ ^ ],

http://msdn.microsoft.com/en-us/ library / system.windows.forms.splitter%28v = vs.110%29.aspx [ ^ ]。



我不喜欢不明白你为什么要点击(分割器通过拖动工作)做任何事情,但没有什么能阻止你处理任何续的点击事件滚动你使用。



-SA
Why buying anything if you have two controls to choose from? Please see System.Windows.Forms.Splitter and System.Windows.Forms.SplitContainer:
http://msdn.microsoft.com/en-us/library/system.windows.forms.splitcontainer%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.splitter%28v=vs.110%29.aspx[^].

I don't understand why would you want to do anything on click (splitters work by dragging), but nothing prevents you from handling the click events on any control you use.

—SA


你想让拆分器滑出单击按钮时?如果是这样,只需在按钮处理程序中切换SplitContainer的面板折叠属性之一。例如,



Do you want the splitter to "slide out" when a button is clicked? If so, just toggle one of the panel collapsed properties for the SplitContainer in your button handler. For example,

private void Button_Click(sender, e)
{
    this.splitContainer1.Panel1Collapsed = !this.splitContain1.Panel1Collapsed;
}


这篇关于C#Winform Sliding SplitContainer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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