Button1 - przejście do Form2
Button2 - dodawanie tekstu z textBox do tablicy
namespace Code
{
public partial class Form1 : Form
{
int i = 0;
string[] array = new string[999];
public Form1()
{
InitializeComponent();
this.button1.Click += new EventHandler(button1_Click);
this.button2.Click += new EventHandler(button2_Click);
}
private void button1_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2(array, i);
form2.Show();
this.Hide();
}
private void button2_Click(object sender, EventArgs e)
{
array[i] = textBox1.Text;
i++;
}
private void label3_Click(object sender, EventArgs e)
{
}
private void label2_Click(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button1_Click_1(object sender, EventArgs e)
{
}
}
}
namespace Code
{
public partial class Form2 : Form
{
public Form2(string[] array, int i)
{
for (int j=0;j< i; j++)
{
Console.WriteLine(array[i]);
}
}
}
}