fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18.  
  19. private void Form1_Load(object sender, EventArgs e)
  20. {
  21. CollapsiblePanel cp = new CollapsiblePanel();
  22. this.Controls.Add(cp);
  23. }
  24. }
  25. //
  26. public class CollapsiblePanel : SplitContainer
  27. {
  28. public Button OpenCloseButton;
  29. public TextBox TextBox;
  30. public CollapsiblePanel()
  31. {
  32. this.Orientation = Orientation.Horizontal;
  33. this.IsSplitterFixed = false;
  34. this.OpenCloseButton = new Button();
  35. this.OpenCloseButton.Dock = DockStyle.Fill;
  36. this.OpenCloseButton.Click += new EventHandler(_OpenCloseButton_Click);
  37. this.Panel1.Controls.Add(OpenCloseButton);
  38. this.TextBox = new TextBox();
  39. this.TextBox.Multiline = true;
  40. this.TextBox.Dock = DockStyle.Fill;
  41. this.Panel2.Controls.Add(TextBox);
  42.  
  43. }
  44.  
  45. void CollapsiblePanel_SizeChanged(object sender, EventArgs e)
  46. {
  47. }
  48.  
  49. void _OpenCloseButton_Click(object sender, EventArgs e)
  50. {
  51. this.Panel2Collapsed = !this.Panel2Collapsed;
  52. }
  53. }
  54. }
  55.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty