При запуске winforms ничего не выводит
вот проблема! прошу помочь
код первого form:
namespace algo
{
public partial class меню : Form
{
public меню()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Сортровка newForm = new Сортровка();
newForm.Show();
}
}
}
код programm cs:
namespace algo
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form());
}
}
}
код второй формы (сортровка):
namespace algo
{
public partial class Сортровка : Form
{
int i = 0,t;
string str;
int[] myArr = new int[10];
public Сортровка()
{
InitializeComponent();
}
private void Сортровка_Load(object sender, EventArgs e)
{
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void pictureBox1_Click_1(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
if (i < 10)
{
myArr[i] = Int32.Parse(textBox2.Text);
i++;
} else
{
for (int i = 0; i < 10; i++)
{
for(int j = 0; j < 9; j++)
{
if(myArr[j] < myArr[j+1])
{
t = myArr[j];
myArr[j] = myArr[j + 1];
myArr[j + 1] = t;
}
}
}
for(int i = 0; i < 10; i++)
{
str = str + " " + myArr[i].ToString();
}
jauap.Text = str;
}
}
}
}
Ответы (1 шт):
Автор решения: Igor
→ Ссылка
public partial class меню : Form
^^^^
public partial class Сортровка : Form
^^^^^^^^^
Application.Run(new Form());
^^^^
Вы создаете форму - экземпляр базового класса Form, на кoтором ничего нет.
