c# – winforms手风琴

前端之家收集整理的这篇文章主要介绍了c# – winforms手风琴前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
有谁知道c# winforms手风琴控制?

优先开源或免费.

解决方法

这是一个基本示例,它使用CheckBox控件,Appearance设置为Button的标题. Download accordion.cs on sourceforge.

演示代码

Accordion acc = new Accordion();
    acc.CheckBoxMargin = new Padding(2);
    acc.ContentMargin = new Padding(15,5,15,5);
    acc.ContentPadding = new Padding(1);
    acc.Insets = new Padding(5);
    acc.ControlBackColor = Color.White;
    acc.ContentBackColor = Color.CadetBlue;

    TableLayoutPanel tlp = new TableLayoutPanel { Dock = DockStyle.Fill,Padding = new Padding(5) };
    tlp.TabStop = true;
    tlp.Controls.Add(new Label { Text = "First Name",TextAlign = ContentAlignment.BottomLeft },0);
    tlp.Controls.Add(new TextBox(),1,0);
    tlp.Controls.Add(new Label { Text = "Last Name",1);
    tlp.Controls.Add(new TextBox(),1);

    acc.Add(tlp,"Contact Info","Enter the client's information.",true);
    acc.Add(new TextBox { Dock = DockStyle.Fill,Multiline = true,BackColor = Color.White },"Memo","Additional Client Info",true,contentBackColor:Color.Transparent);
    acc.Add(new Control(),"Other Info","Miscellaneous information.");

猜你在找的C#相关文章