PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/Samples/ExampleToolForm/ExampleForm.cs

#
C# | 37 lines | 25 code | 3 blank | 9 comment | 0 complexity | 8ed995119b5d497df99af207b82602ea MD5 | raw file
Possible License(s): Apache-2.0
  1. using System.Windows.Forms;
  2. using Application = Delta.Engine.Application;
  3. namespace Delta.Tools.ExampleToolForm
  4. {
  5. /// <summary>
  6. /// Example form, will just hock up some Windows Forms events.
  7. /// </summary>
  8. public partial class ExampleForm : Form
  9. {
  10. #region Constructor
  11. /// <summary>
  12. /// Create example form
  13. /// </summary>
  14. public ExampleForm()
  15. {
  16. InitializeComponent();
  17. // The update button click event
  18. statusUpdateButton.Click += delegate
  19. {
  20. // How big is the viewportPanel
  21. viewportLabel.Text =
  22. "Viewport: " + viewportPanel.ClientSize +
  23. ", Graphic=" + Application.Window.ViewportPixelWidth + ", " +
  24. Application.Window.ViewportPixelHeight;
  25. };
  26. // Quit with the extra quit button (rest happens in Program.cs)
  27. menuExitItem.Click += delegate
  28. {
  29. Application.Quit();
  30. };
  31. }
  32. #endregion
  33. }
  34. }