public DROControl() { InitializeComponent(); this.DisplayFormat = "F3"; this.btnZeroAll.Click += new EventHandler(btnZero_Click); for (int i = 0; i < axes.Length; i++) { axes[i] = new AxisData(); switch (i) { case GrblConstants.X_AXIS: axes[GrblConstants.X_AXIS].DRO = this.droX; break; case GrblConstants.Y_AXIS: axes[GrblConstants.Y_AXIS].DRO = this.droY; break; case GrblConstants.Z_AXIS: axes[GrblConstants.Z_AXIS].DRO = this.droZ; break; case GrblConstants.A_AXIS: axes[GrblConstants.A_AXIS].DRO = this.droA; break; case GrblConstants.B_AXIS: axes[GrblConstants.B_AXIS].DRO = this.droB; break; case GrblConstants.C_AXIS: axes[GrblConstants.C_AXIS].DRO = this.droC; break; } axes[i].DRO.Label = GrblInfo.AxisLetters.Substring(i, 1); axes[i].visible = i < 3; axes[i].DRO.Readout.GotFocus += new EventHandler(txtPos_GotFocus); axes[i].DRO.Readout.LostFocus += new EventHandler(txtPos_LostFocus); axes[i].DRO.Readout.KeyPress += new KeyPressEventHandler(txtPos_KeyPress); axes[i].DRO.Zero.Click += new EventHandler(btnZero_Click); setPos(i, 0.0); } }
public DROControl() { InitializeComponent(); this.DisplayFormat = "F3"; this.btnZeroAll.Click += new EventHandler(btnZero_Click); for (int i = 0; i < axes.Length; i++) { axes[i] = new AxisData(); switch (i) { case XAXIS: axes[XAXIS].textBox = this.txtXPos; axes[XAXIS].btnZero = this.btnXZero; break; case YAXIS: axes[YAXIS].textBox = this.txtYPos; axes[YAXIS].btnZero = this.btnYZero; break; case ZAXIS: axes[ZAXIS].textBox = this.txtZPos; axes[ZAXIS].btnZero = this.btnZZero; break; } axes[i].textBox.GotFocus += new EventHandler(txtPos_GotFocus); axes[i].textBox.LostFocus += new EventHandler(txtPos_LostFocus); axes[i].textBox.KeyPress += new KeyPressEventHandler(txtPos_KeyPress); axes[i].btnZero.Click += new EventHandler(btnZero_Click); setPos(i, 0.0); } }