Тема: Підкажіть як правильно записати функцію Show?
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static void CreatePop(string []pop ,int left_b, int right_b,int pop_size)
{
Random rnd = new Random();
int hrom;
for (int i = 0; i < pop_size; i++)
{
hrom = rnd.Next(left_b, right_b);
pop[i]=Convert.ToString(hrom,2);
}
}
public static void Show(string[] pop, int pop_size)
{
for (int i = 0; i < pop_size; i++)
listBox1.Items.Add(pop[i]);
}
private void button1_Click(object sender, EventArgs e)
{
int left_b, right_b, pop_size;
string[] pop;
left_b = Convert.ToInt16(textBox1.Text);
right_b = Convert.ToInt16(textBox2.Text);
pop_size = Convert.ToInt16(textBox3.Text);
pop = new string[pop_size];
Form1.CreatePop(pop, left_b, right_b, pop_size);
Form1.Show(pop,pop_size);
}
}
}