手风琴手风琴 [英] winforms accordion

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

问题描述

有人知道 c# winforms 手风琴控件吗?

anyone know a c# winforms accordion control?

最好是开源的或免费的.

preferrably open source or free.

推荐答案

这是一个使用 CheckBox 控件的基本示例,其中 Appearance 设置为 Button 用于标题.在 sourceforge 上下载手风琴.cs.

Here is a basic example that uses CheckBox controls with Appearance set to Button for the headers. 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, 0);
    tlp.Controls.Add(new TextBox(), 1, 0);
    tlp.Controls.Add(new Label { Text = "Last Name", TextAlign = ContentAlignment.BottomLeft }, 0, 1);
    tlp.Controls.Add(new TextBox(), 1, 1);

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

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

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