TestForm.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. namespace TestProject
  8. {
  9. /// <summary>
  10. /// Summary description for Form1.
  11. /// </summary>
  12. public class TestForm : System.Windows.Forms.Form
  13. {
  14. private Test.TestControl tc;
  15. private System.Windows.Forms.ImageList il_Images;
  16. private CustomControls.Win32Controls.PushButton btn_Controls;
  17. private System.ComponentModel.IContainer components;
  18. public TestForm()
  19. {
  20. //
  21. // Required for Windows Form Designer support
  22. //
  23. InitializeComponent();
  24. //
  25. // TODO: Add any constructor code after InitializeComponent call
  26. //
  27. }
  28. /// <summary>
  29. /// Clean up any resources being used.
  30. /// </summary>
  31. protected override void Dispose( bool disposing )
  32. {
  33. if( disposing )
  34. {
  35. if (components != null)
  36. {
  37. components.Dispose();
  38. }
  39. }
  40. base.Dispose( disposing );
  41. }
  42. #region Windows Form Designer generated code
  43. /// <summary>
  44. /// Required method for Designer support - do not modify
  45. /// the contents of this method with the code editor.
  46. /// </summary>
  47. private void InitializeComponent()
  48. {
  49. this.components = new System.ComponentModel.Container();
  50. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TestForm));
  51. this.tc = new Test.TestControl();
  52. this.il_Images = new System.Windows.Forms.ImageList(this.components);
  53. this.btn_Controls = new CustomControls.Win32Controls.PushButton();
  54. this.SuspendLayout();
  55. //
  56. // tc
  57. //
  58. this.tc.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  59. this.tc.Location = new System.Drawing.Point(8, 8);
  60. this.tc.Name = "tc";
  61. this.tc.SimpleItem.Name = "SimpleItem";
  62. this.tc.Size = new System.Drawing.Size(120, 97);
  63. this.tc.TabIndex = 0;
  64. this.tc.Text = "Test Control";
  65. this.tc.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  66. this.tc.Click += new System.EventHandler(this.tc_Click);
  67. //
  68. // il_Images
  69. //
  70. this.il_Images.ImageSize = new System.Drawing.Size(16, 16);
  71. this.il_Images.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("il_Images.ImageStream")));
  72. this.il_Images.TransparentColor = System.Drawing.Color.Transparent;
  73. //
  74. // btn_Controls
  75. //
  76. this.btn_Controls.Image = ((System.Drawing.Image)(resources.GetObject("btn_Controls.Image")));
  77. this.btn_Controls.Location = new System.Drawing.Point(141, 80);
  78. this.btn_Controls.Name = "btn_Controls";
  79. this.btn_Controls.Size = new System.Drawing.Size(104, 24);
  80. this.btn_Controls.TabIndex = 1;
  81. this.btn_Controls.Text = "Custom Controls";
  82. this.btn_Controls.Click += new System.EventHandler(this.btn_Controls_Click);
  83. //
  84. // TestForm
  85. //
  86. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  87. this.ClientSize = new System.Drawing.Size(256, 113);
  88. this.Controls.Add(this.btn_Controls);
  89. this.Controls.Add(this.tc);
  90. this.ForeColor = System.Drawing.SystemColors.Desktop;
  91. this.Name = "TestForm";
  92. this.Text = "Test Form";
  93. this.ResumeLayout(false);
  94. }
  95. #endregion
  96. /// <summary>
  97. /// The main entry point for the application.
  98. /// </summary>
  99. [STAThread]
  100. static void Main()
  101. {
  102. //Application.Run(new CustomControlsForm());
  103. Application.Run(new TestForm());
  104. }
  105. private void tc_Click(object sender, System.EventArgs e)
  106. {
  107. Test.CollectionEditors.CustomCollectionEditorDialog cced= new Test.CollectionEditors.CustomCollectionEditorDialog();
  108. cced.Text="Test Control's Custom Items";
  109. cced.Collection=tc.CustomItems;
  110. cced.ImageList=this.il_Images;
  111. cced.ShowDialog();
  112. }
  113. private void btn_Controls_Click(object sender, System.EventArgs e)
  114. {
  115. CustomControlsForm cForm= new CustomControlsForm();
  116. cForm.ShowDialog();
  117. }
  118. }
  119. }