C# 手风琴手风琴

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1303195/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 14:55:00  来源:igfitidea点击:

winforms accordion

c#winformsaccordionaccordionpane

提问by

anyone know a c# winforms accordion control?

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

preferrably open source or free.

最好是开源的或免费的。

回答by Eric J.

XPTaskBarmight meet your needs. I use the commercial (but reasonably-priced) Krypton Suite

XPTaskBar可能会满足您的需求。我使用商业(但价格合理)的氪气套件

回答by Pavi

Synfusion has GroupBar , its basically Outlook like Left Side Bar Its pretty slick http://www.syncfusion.com/products/user-interface-edition/windows-forms/tools/features#navigation-package

Synfusion 有 GroupBar ,它的基本 Outlook 就像 Left Side Bar 它非常漂亮 http://www.syncfusion.com/products/user-interface-edition/windows-forms/tools/features#navigation-package

回答by Loathing

Here is a basic example that uses CheckBoxcontrols with Appearanceset to Buttonfor the headers. Download accordion.cs on sourceforge.

这是一个基本示例,它使用设置为标题的CheckBox控件。 在 sourceforge 上下载手风琴.cs。AppearanceButton

Demo code:

演示代码:

    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.");

enter image description here

在此处输入图片说明