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
winforms accordion
提问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
回答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 CheckBox
controls with Appearance
set to Button
for the headers. Download accordion.cs on sourceforge.
这是一个基本示例,它使用设置为标题的CheckBox
控件。 在 sourceforge 上下载手风琴.cs。Appearance
Button
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.");