SplitContainerExample.cs 738 B

1234567891011121314151617181920212223242526272829303132
  1. using Terminal.Gui;
  2. using System;
  3. namespace UICatalog.Scenarios {
  4. [ScenarioMetadata (Name: "Split Container", Description: "Demonstrates the SplitContainer functionality")]
  5. [ScenarioCategory ("Controls")]
  6. public class SplitContainerExample : Scenario {
  7. private SplitContainer splitContainer;
  8. /// <summary>
  9. /// Setup the scenario.
  10. /// </summary>
  11. public override void Setup ()
  12. {
  13. // Scenario Window's.
  14. Win.Title = this.GetName ();
  15. splitContainer = new SplitContainer {
  16. Width = Dim.Fill (),
  17. Height = Dim.Fill (),
  18. SplitterDistance = Pos.Percent(50),
  19. };
  20. splitContainer.Panel1.Add (new Label ("Hello"));
  21. splitContainer.Panel2.Add (new Label ("World"));
  22. Win.Add (splitContainer);
  23. }
  24. }
  25. }