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 |
|
---|
8 | namespace csharp
|
---|
9 | {
|
---|
10 | /// <summary>
|
---|
11 | /// Summary description for Form1.
|
---|
12 | /// </summary>
|
---|
13 | public class Form1 : System.Windows.Forms.Form
|
---|
14 | {
|
---|
15 | private AxwrapperaxLib.AxQPushButton resetButton;
|
---|
16 | private AxmultipleaxLib.AxQAxWidget2 circleWidget;
|
---|
17 | /// <summary>
|
---|
18 | /// Required designer variable.
|
---|
19 | /// </summary>
|
---|
20 | private System.ComponentModel.Container components = null;
|
---|
21 |
|
---|
22 | public Form1()
|
---|
23 | {
|
---|
24 | //
|
---|
25 | // Required for Windows Form Designer support
|
---|
26 | //
|
---|
27 | InitializeComponent();
|
---|
28 |
|
---|
29 | //
|
---|
30 | // TODO: Add any constructor code after InitializeComponent call
|
---|
31 | //
|
---|
32 | }
|
---|
33 |
|
---|
34 | /// <summary>
|
---|
35 | /// Clean up any resources being used.
|
---|
36 | /// </summary>
|
---|
37 | protected override void Dispose( bool disposing )
|
---|
38 | {
|
---|
39 | if( disposing )
|
---|
40 | {
|
---|
41 | if (components != null)
|
---|
42 | {
|
---|
43 | components.Dispose();
|
---|
44 | }
|
---|
45 | }
|
---|
46 | base.Dispose( disposing );
|
---|
47 | }
|
---|
48 |
|
---|
49 | #region Windows Form Designer generated code
|
---|
50 | /// <summary>
|
---|
51 | /// Required method for Designer support - do not modify
|
---|
52 | /// the contents of this method with the code editor.
|
---|
53 | /// </summary>
|
---|
54 | private void InitializeComponent()
|
---|
55 | {
|
---|
56 | System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
|
---|
57 | this.resetButton = new AxwrapperaxLib.AxQPushButton();
|
---|
58 | this.circleWidget = new AxmultipleaxLib.AxQAxWidget2();
|
---|
59 | ((System.ComponentModel.ISupportInitialize)(this.resetButton)).BeginInit();
|
---|
60 | ((System.ComponentModel.ISupportInitialize)(this.circleWidget)).BeginInit();
|
---|
61 | this.SuspendLayout();
|
---|
62 | //
|
---|
63 | // resetButton
|
---|
64 | //
|
---|
65 | this.resetButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
|
---|
66 | this.resetButton.Enabled = true;
|
---|
67 | this.resetButton.Location = new System.Drawing.Point(160, 296);
|
---|
68 | this.resetButton.Name = "resetButton";
|
---|
69 | this.resetButton.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("resetButton.OcxState")));
|
---|
70 | this.resetButton.Size = new System.Drawing.Size(168, 32);
|
---|
71 | this.resetButton.TabIndex = 1;
|
---|
72 | this.resetButton.clicked += new System.EventHandler(this.resetLineWidth);
|
---|
73 | //
|
---|
74 | // circleWidget
|
---|
75 | //
|
---|
76 | this.circleWidget.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
---|
77 | | System.Windows.Forms.AnchorStyles.Left)
|
---|
78 | | System.Windows.Forms.AnchorStyles.Right);
|
---|
79 | this.circleWidget.Enabled = true;
|
---|
80 | this.circleWidget.Location = new System.Drawing.Point(8, 8);
|
---|
81 | this.circleWidget.Name = "circleWidget";
|
---|
82 | this.circleWidget.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("circleWidget.OcxState")));
|
---|
83 | this.circleWidget.Size = new System.Drawing.Size(320, 264);
|
---|
84 | this.circleWidget.TabIndex = 2;
|
---|
85 | this.circleWidget.ClickEvent += new System.EventHandler(this.circleClicked);
|
---|
86 | //
|
---|
87 | // Form1
|
---|
88 | //
|
---|
89 | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
|
---|
90 | this.ClientSize = new System.Drawing.Size(336, 333);
|
---|
91 | this.Controls.AddRange(new System.Windows.Forms.Control[] {
|
---|
92 | this.circleWidget,
|
---|
93 | this.resetButton});
|
---|
94 | this.Name = "Form1";
|
---|
95 | this.Text = "Form1";
|
---|
96 | ((System.ComponentModel.ISupportInitialize)(this.resetButton)).EndInit();
|
---|
97 | ((System.ComponentModel.ISupportInitialize)(this.circleWidget)).EndInit();
|
---|
98 | this.ResumeLayout(false);
|
---|
99 |
|
---|
100 | }
|
---|
101 | #endregion
|
---|
102 |
|
---|
103 | /// <summary>
|
---|
104 | /// The main entry point for the application.
|
---|
105 | /// </summary>
|
---|
106 | [STAThread]
|
---|
107 | static void Main()
|
---|
108 | {
|
---|
109 | Application.Run(new Form1());
|
---|
110 | }
|
---|
111 |
|
---|
112 | //! [0]
|
---|
113 | private void circleClicked(object sender, System.EventArgs e)
|
---|
114 | {
|
---|
115 | this.circleWidget.lineWidth++;
|
---|
116 | }
|
---|
117 | //! [0]
|
---|
118 |
|
---|
119 | //! [1]
|
---|
120 | private void resetLineWidth(object sender, System.EventArgs e)
|
---|
121 | {
|
---|
122 | this.circleWidget.lineWidth = 1;
|
---|
123 | this.resetButton.setFocus();
|
---|
124 | }
|
---|
125 | //! [1]
|
---|
126 | }
|
---|
127 | }
|
---|