質問編集履歴

1

修正

2016/03/01 06:33

投稿

fender0131
fender0131

スコア121

test CHANGED
File without changes
test CHANGED
@@ -60,24 +60,144 @@
60
60
 
61
61
  {
62
62
 
63
+ this.KeyPreview = true;
64
+
65
+ }
66
+
67
+
68
+
69
+ private void Form1_Shown(object sender, EventArgs e)
70
+
71
+ {
72
+
73
+ byouga();
74
+
75
+ }
76
+
77
+
78
+
79
+ private void button1_Click(object sender, EventArgs e)
80
+
81
+ {
82
+
83
+ byouga();
84
+
85
+ }
86
+
87
+
88
+
89
+ private void byouga()
90
+
91
+ {
92
+
93
+ //Panel1のGraphicsオブジェクトを作成
94
+
95
+ Graphics g = pictureBox1.CreateGraphics();
96
+
97
+
98
+
99
+ // penを作成
100
+
101
+ Pen greenPen = new Pen(Color.Green, 5);
102
+
103
+
104
+
105
+ // lineの始点と終点を設定
106
+
107
+ Point Start_point5 = new Point(50, 200);
108
+
109
+ Point End_point5 = new Point(250, 200);
110
+
111
+
112
+
113
+ // lineを描画
114
+
115
+ g.DrawLine(greenPen, Start_point5, End_point5);
116
+
117
+
118
+
119
+ // penを解放する
120
+
121
+ greenPen.Dispose();
122
+
123
+
124
+
125
+ // Graphicsを解放する
126
+
127
+ g.Dispose();
128
+
129
+ }
130
+
131
+ }
132
+
133
+ }
134
+
135
+
136
+
137
+ ```
138
+
139
+
140
+
141
+ ```ここに言語を入力
142
+
143
+ using System;
144
+
145
+ using System.Collections.Generic;
146
+
147
+ using System.ComponentModel;
148
+
149
+ using System.Data;
150
+
151
+ using System.Drawing;
152
+
153
+ using System.Linq;
154
+
155
+ using System.Text;
156
+
157
+ using System.Threading.Tasks;
158
+
159
+ using System.Windows.Forms;
160
+
161
+
162
+
163
+ namespace WindowsFormsApplication8
164
+
165
+ {
166
+
167
+ public partial class Form1 : Form
168
+
169
+ {
170
+
171
+ public Form1()
172
+
173
+ {
174
+
175
+ InitializeComponent();
176
+
177
+ }
178
+
179
+
180
+
181
+ private void Form1_Load(object sender, EventArgs e)
182
+
183
+ {
184
+
63
185
  this.KeyPreview = true;
64
186
 
187
+ }
188
+
189
+
190
+
191
+ private void button1_Click(object sender, EventArgs e)
192
+
193
+ {
194
+
65
195
  byouga();
66
196
 
67
197
  }
68
198
 
69
199
 
70
200
 
71
- private void button1_Click(object sender, EventArgs e)
72
-
73
- {
74
-
75
-
76
-
77
- }
78
-
79
-
80
-
81
201
  private void byouga()
82
202
 
83
203
  {
@@ -132,120 +252,6 @@
132
252
 
133
253
 
134
254
 
135
- ```ここに言語を入力
136
-
137
- using System;
138
-
139
- using System.Collections.Generic;
140
-
141
- using System.ComponentModel;
142
-
143
- using System.Data;
144
-
145
- using System.Drawing;
146
-
147
- using System.Linq;
148
-
149
- using System.Text;
150
-
151
- using System.Threading.Tasks;
152
-
153
- using System.Windows.Forms;
154
-
155
-
156
-
157
- namespace WindowsFormsApplication8
158
-
159
- {
160
-
161
- public partial class Form1 : Form
162
-
163
- {
164
-
165
- public Form1()
166
-
167
- {
168
-
169
- InitializeComponent();
170
-
171
- }
172
-
173
-
174
-
175
- private void Form1_Load(object sender, EventArgs e)
176
-
177
- {
178
-
179
- this.KeyPreview = true;
180
-
181
- }
182
-
183
-
184
-
185
- private void button1_Click(object sender, EventArgs e)
186
-
187
- {
188
-
189
- byouga();
190
-
191
- }
192
-
193
-
194
-
195
- private void byouga()
196
-
197
- {
198
-
199
- //Panel1のGraphicsオブジェクトを作成
200
-
201
- Graphics g = pictureBox1.CreateGraphics();
202
-
203
-
204
-
205
- // penを作成
206
-
207
- Pen greenPen = new Pen(Color.Green, 5);
208
-
209
-
210
-
211
- // lineの始点と終点を設定
212
-
213
- Point Start_point5 = new Point(50, 200);
214
-
215
- Point End_point5 = new Point(250, 200);
216
-
217
-
218
-
219
- // lineを描画
220
-
221
- g.DrawLine(greenPen, Start_point5, End_point5);
222
-
223
-
224
-
225
- // penを解放する
226
-
227
- greenPen.Dispose();
228
-
229
-
230
-
231
- // Graphicsを解放する
232
-
233
- g.Dispose();
234
-
235
- }
236
-
237
-
238
-
239
- }
240
-
241
- }
242
-
243
-
244
-
245
- ```
246
-
247
-
248
-
249
255
 
250
256
 
251
257