You are on page 1of 2

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;

namespace task1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Next_Click(object sender, EventArgs e)


{
Form2 Form2 = new Form2();
this.Close();
//this.Visible = false;
Form2.Show();

private void Form1_Load(object sender, EventArgs e)


{
for(int i=18; i<=80; i++)
{
comboBox1.Items.Add(i.ToString());
}
}

private void button1_Click(object sender, EventArgs e)


{
String name = textBox1.Text.ToString();
string surname = textBox2.Text.ToString();
int age = int.Parse(comboBox1.Text);
string gender = radioButton1.Checked ? "Male" : "Female";
Form2 Form2 = new Form2(name, surname, age, gender);
Form2.Show();

}
}
}

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;

namespace task1
{
public partial class Form2 : Form
{
public Form2((string name, string surname, int age, string gender)
{
InitializeComponent();
label1.Text = name;
label2.Text = surname;
label3.Text = age.ToString();
label4.Text = gender;

private void Previous_Click(object sender, EventArgs e)


{
Form1 Form1 = new Form1();
//this.Close();
//this.Visible = false;
Form1.Show();
}
}
}

You might also like