using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form2 : Form { public Form2() { InitializeComponent(); } public int width; public int height; private void button1_Click(object sender, EventArgs e) { width = Convert.ToInt32(numericUpDown1.Value); height = Convert.ToInt32(numericUpDown2.Value); this.Close(); } } }