само рисование щелкаю второй цвет и первый исчезает
Добавлено через 1 час 0 минут
| VB.NET | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
| ublic Class Form1
Dim graf As Graphics
Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
F1 = Me
End Sub
' Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
'End Sub
'Кнопка 1 ввода данных на PictureBox
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
fff()
End Sub
'Кнопка 2 ввода данных на PictureBox
Private Sub Button7_Click(sender As System.Object, e As System.EventArgs) Handles Button7.Click
fff1()
End Sub
'Кнопка 3 ввода данных на PictureBox
Private Sub Button8_Click(sender As System.Object, e As System.EventArgs) Handles Button8.Click
fff2()
End Sub
'Кнопка 4 ввода данных на PictureBox
Private Sub Button9_Click(sender As System.Object, e As System.EventArgs) Handles Button9.Click
fff3()
End Sub
'Кнопка 5 ввода данных на PictureBox
Private Sub Button10_Click(sender As System.Object, e As System.EventArgs) Handles Button10.Click
fff4()
End Sub
'Кнопка 6 ввода данных на PictureBox
Private Sub Button12_Click(sender As System.Object, e As System.EventArgs) Handles Button12.Click
fff5()
End Sub
'Кнопка 7 ввода данных на PictureBox
Private Sub Button11_Click(sender As System.Object, e As System.EventArgs) Handles Button11.Click
fff6()
End Sub
'Кнопка 8 ввода данных на PictureBox
Private Sub Button13_Click(sender As System.Object, e As System.EventArgs) Handles Button13.Click
fff7()
End Sub
'Блок данных 1
Public Sub fff()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
Dim MyBMP As New Bitmap(PictureBox1.Width, PictureBox1.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
graf = Graphics.FromImage(MyBMP)
PictureBox1.Image = MyBMP
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 56, FontStyle.Bold), Brushes.Black, 36, 12)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 32, FontStyle.Bold), Brushes.Black, 5, 120)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 32, FontStyle.Bold), Brushes.Black, 5, 148)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 32, FontStyle.Bold), Brushes.Black, 5, 196)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 32, FontStyle.Bold), Brushes.Black, 5, 244)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 24)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 36)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 48)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 2
Public Sub fff1()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 114, 3)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 25)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 37)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 49)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 61)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 24)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 36)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 48)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 3
Public Sub fff2()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 9, 75)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 100)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 112)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 124)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 136)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 99)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 111)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 123)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 4
Public Sub fff3()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 114, 75)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 100)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 112)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 124)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 136)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 99)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 111)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 123)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 5
Public Sub fff4()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 9, 150)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 175)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 187)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 199)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 211)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 174)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 186)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 198)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 6
Public Sub fff5()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 114, 150)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 175)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 187)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 199)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 211)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 174)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 186)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 198)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 7
Public Sub fff6()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 9, 225)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 250)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 262)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 274)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 286)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 249)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 261)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 273)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 8
Public Sub fff7()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 114, 225)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 250)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 262)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 274)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 223)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 249)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 261)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 273)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Очистить PictureBox
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
graf.Clear(Color.White)
End Sub
'Отображает введенный текст на ComboBox1 в ListBox1
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
ListBox1.Items.Add(ComboBox1.Text)
End Sub
'Очистка данных в ListBox1
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
ListBox1.Items.Clear()
End Sub
'Отображает введенный текст на ComboBox2 в ListBox2
Private Sub ComboBox2_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
ListBox2.Items.Add(ComboBox2.Text)
End Sub
'Очистка данных в ListBox2
Private Sub Button4_Click_1(sender As System.Object, e As System.EventArgs) Handles Button4.Click
ListBox2.Items.Clear()
End Sub
'Ограничение введения кол.знаков до7 в TextBox1
Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.MaxLength = 7
End Sub
' Открытие второй формы
Private Sub AddNewColorToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AddNewColorToolStripMenuItem.Click
F2 = New Form2
F2.Show()
End Sub
Private WithEvents PD As PrintDocument
Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
Dim pdialog As New PrintDialog
If pdialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
PD = New PrintDocument()
PD.PrinterSettings = pdialog.PrinterSettings
PD.Print()
End If
End Sub
''' <summary>Событие печати</summary>
Private Sub PD_PrintPage(sender As Object, e As PrintPageEventArgs) Handles PD.PrintPage
If PictureBox1.Image IsNot Nothing Then
e.Graphics.DrawImage(PictureBox1.Image, 0, 0)
End If
End Sub
End Class |
|
Добавлено через 6 минут
| VB.NET | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
| Imports System.Drawing.Printing
Public Class Form1
Dim graf As Graphics
Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
F1 = Me
End Sub
' Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
'End Sub
'Кнопка 1 ввода данных на PictureBox
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
fff()
End Sub
'Кнопка 2 ввода данных на PictureBox
Private Sub Button7_Click(sender As System.Object, e As System.EventArgs) Handles Button7.Click
fff1()
End Sub
'Кнопка 3 ввода данных на PictureBox
Private Sub Button8_Click(sender As System.Object, e As System.EventArgs) Handles Button8.Click
fff2()
End Sub
'Кнопка 4 ввода данных на PictureBox
Private Sub Button9_Click(sender As System.Object, e As System.EventArgs) Handles Button9.Click
fff3()
End Sub
'Кнопка 5 ввода данных на PictureBox
Private Sub Button10_Click(sender As System.Object, e As System.EventArgs) Handles Button10.Click
fff4()
End Sub
'Кнопка 6 ввода данных на PictureBox
Private Sub Button12_Click(sender As System.Object, e As System.EventArgs) Handles Button12.Click
fff5()
End Sub
'Кнопка 7 ввода данных на PictureBox
Private Sub Button11_Click(sender As System.Object, e As System.EventArgs) Handles Button11.Click
fff6()
End Sub
'Кнопка 8 ввода данных на PictureBox
Private Sub Button13_Click(sender As System.Object, e As System.EventArgs) Handles Button13.Click
fff7()
End Sub
'Блок данных 1
Public Sub fff()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
Dim MyBMP As New Bitmap(PictureBox1.Width, PictureBox1.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
graf = Graphics.FromImage(MyBMP)
PictureBox1.Image = MyBMP
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 56, FontStyle.Bold), Brushes.Black, 36, 12)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 32, FontStyle.Bold), Brushes.Black, 5, 120)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 32, FontStyle.Bold), Brushes.Black, 5, 148)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 32, FontStyle.Bold), Brushes.Black, 5, 196)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 32, FontStyle.Bold), Brushes.Black, 5, 244)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 24)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 36)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 48)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 2
Public Sub fff1()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 114, 3)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 25)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 37)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 49)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 61)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 24)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 36)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 48)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 3
Public Sub fff2()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 9, 75)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 100)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 112)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 124)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 136)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 99)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 111)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 123)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 4
Public Sub fff3()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 114, 75)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 100)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 112)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 124)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 136)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 99)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 111)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 123)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 5
Public Sub fff4()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 9, 150)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 175)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 187)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 199)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 211)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 174)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 186)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 198)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 6
Public Sub fff5()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 114, 150)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 175)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 187)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 199)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 211)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 174)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 186)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 198)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 7
Public Sub fff6()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 9, 225)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 250)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 262)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 274)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 286)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 249)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 261)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 273)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Блок данных 8
Public Sub fff7()
'Переменные
Dim Com1 As String = ComboBox1.Text
Dim degem As String = TextBox1.Text
Dim zvet As String = ListBox1.SelectedItem
Dim razmer As String = ListBox2.SelectedItem
graf = PictureBox1.CreateGraphics
'Очистка TextBox1
TextBox1.Clear()
'Отображение данных в PictureBox1
graf.DrawString(degem, New Font("Arial", 14, FontStyle.Bold), Brushes.Black, 114, 225)
' Блок для введения значений цвета на PictureBox1
If ListBox1.SelectedItem = Nothing Then
MsgBox("Select color !")
ElseIf zvet = (ListBox1.Items(0)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 250)
ElseIf zvet = (ListBox1.Items(1)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 262)
ElseIf zvet = (ListBox1.Items(2)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 274)
ElseIf zvet = (ListBox1.Items(3)) Then
graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 114, 223)
' ElseIf zvet = (ListBox1.Items(4)) Then
' graf.DrawString(zvet, New Font("Arial", 8, FontStyle.Bold), Brushes.Black, 4, 11)
End If
ListBox1.SelectedItem = Nothing
' Блок для введения значений размера на PictureBox1
If ListBox2.SelectedItem = Nothing Then
MsgBox("Select size !")
'ElseIf razmer = (ListBox2.Items(0)) Then
'graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 79, 8)
ElseIf razmer = (ListBox2.Items(0)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 249)
ElseIf razmer = (ListBox2.Items(1)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 261)
ElseIf razmer = (ListBox2.Items(2)) Then
graf.DrawString(razmer, New Font("Arial", 10, FontStyle.Bold), Brushes.Black, 184, 273)
End If
ListBox2.SelectedItem = Nothing
End Sub
'Очистить PictureBox
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
graf.Clear(Color.White)
End Sub
'Отображает введенный текст на ComboBox1 в ListBox1
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
ListBox1.Items.Add(ComboBox1.Text)
End Sub
'Очистка данных в ListBox1
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
ListBox1.Items.Clear()
End Sub
'Отображает введенный текст на ComboBox2 в ListBox2
Private Sub ComboBox2_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
ListBox2.Items.Add(ComboBox2.Text)
End Sub
'Очистка данных в ListBox2
Private Sub Button4_Click_1(sender As System.Object, e As System.EventArgs) Handles Button4.Click
ListBox2.Items.Clear()
End Sub
'Ограничение введения кол.знаков до7 в TextBox1
Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
TextBox1.MaxLength = 7
End Sub
' Открытие второй формы
Private Sub AddNewColorToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AddNewColorToolStripMenuItem.Click
F2 = New Form2
F2.Show()
End Sub
Private WithEvents PD As PrintDocument
Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
Dim pdialog As New PrintDialog
If pdialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
PD = New PrintDocument()
PD.PrinterSettings = pdialog.PrinterSettings
PD.Print()
End If
End Sub
''' <summary>Событие печати</summary>
Private Sub PD_PrintPage(sender As Object, e As PrintPageEventArgs) Handles PD.PrintPage
If PictureBox1.Image IsNot Nothing Then
e.Graphics.DrawImage(PictureBox1.Image, 0, 0)
End If
End Sub
End Class |
|
Добавлено через 14 часов 35 минут
Алекс,это получается ,что в режиме Bitmap новое значение накладываеся на Picturebox как новый, чистый лист бумаги ,перекрывая прежний рисунок да? а что делать прежде я на Picturebox как хотел выводил значения.
0
|