using System using System Collections Generic using System ComponentMo

 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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
label1.BackColor = Color.Transparent;
label2.BackColor = Color.Transparent;
label3.BackColor = Color.Transparent;
button1.FlatAppearance.BorderSize = 0;
button1.FlatStyle = FlatStyle.Flat;
}
private void button1_Click(object sender, EventArgs e)
{
if (listBox1.SelectedIndex == 0)
{
Lab1 idk = new Lab1();
textBox1.Visible = true;
textBox2.Visible = true;
textBox3.Visible = true;
label2.Text = "Before";
label1.Text = "After";
label3.Text = "Sorted";
textBox1.Text = idk.print(idk.a);
idk.Solu();
textBox3.Text = idk.print(idk.a);
idk.swp();
textBox2.Text = idk.print(idk.a2);
}
else if (listBox1.SelectedIndex == 1)
{
Lab2 idk = new Lab2();
textBox2.Visible = false;
textBox1.Visible = true;
textBox3.Visible = false;
label1.Text = "";
label3.Text = "";
textBox1.Text = idk.Print(idk.a);
idk.Solu();
if (idk.mgc == true)
label2.Text = "Its magic!";
else
label2.Text = "Its not magic :(";
}
else if (listBox1.SelectedIndex == 2)
{
Lab4 idk = new Lab4();
textBox1.Visible = true;
textBox3.Visible = true;
textBox2.Visible = false;
label1.Text = "After";
label2.Text = "Before";
label3.Text = "";
textBox1.Text = idk.Print(idk.arr);
idk.Solu();
textBox3.Text = idk.Print(idk.arr);
}
else
{
MessageBox.Show("Ни один из элементов не был выбран.", "Ошибочка");
}
}
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
listBox1.ClearSelected();
}
}
}