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 TrackMaker4 { //This form is intended to set the width and heiht of the track layout public partial class TrackLayout : Form { int xnum = 0; int ynum = 0; public TrackLayout() { InitializeComponent(); } public int Xnum//X value of grid { set { xnum = value; } get { return xnum; } } public int Ynum//Y value of grid { set { ynum = value; } get { return ynum; } } private void bttnOK_Click(object sender, EventArgs e) { //These numbers are to be used for the grid ynum = Convert.ToInt32(tbxY.Text);//Get the values from the textboxes xnum = Convert.ToInt32(tbxX.Text); //Keep the grid 20 or Under if (ynum > 20) ynum = 20; if (xnum > 20) xnum = 20; DialogResult = DialogResult.OK; } } }