singlewidget.cs 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // System.Windows.Forms Demo app
  3. //
  4. // Authors:
  5. // Philip Van Hoof ([email protected])
  6. //
  7. // I use this sample for testing a single widget
  8. //
  9. using System;
  10. using System.Drawing;
  11. using System.Windows.Forms;
  12. namespace singlewidget
  13. {
  14. public class GtkForm : System.Windows.Forms.Form
  15. {
  16. private HScrollBar hScrollBar1 = new HScrollBar();
  17. private void InitializeWidgets()
  18. {
  19. this.hScrollBar1.Location = new System.Drawing.Point(50, 60);
  20. this.hScrollBar1.Maximum = 200;
  21. this.hScrollBar1.Minimum = 10;
  22. this.hScrollBar1.Name = "hScrollBar1";
  23. this.hScrollBar1.Size = new System.Drawing.Size(360, 24);
  24. this.Controls.AddRange(new System.Windows.Forms.Control[] {
  25. this.hScrollBar1 });
  26. this.Size = new Size(512, 250);
  27. }
  28. public GtkForm()
  29. {
  30. InitializeWidgets();
  31. }
  32. public class GtkMain
  33. {
  34. public static void Main()
  35. {
  36. GtkForm form1 = new GtkForm ();
  37. form1.Text = "System.Windows.Forms at work!";
  38. Application.Run(form1);
  39. }
  40. }
  41. }
  42. }