diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.Designer.cs b/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.Designer.cs index a7f22c6dc..537af4f58 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.Designer.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.Designer.cs @@ -153,6 +153,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox1.Name = "comboBox1"; this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); this.comboBox1.TextChanged += new System.EventHandler(this.comboBox1_TextChanged); + this.comboBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox1_KeyPress); // // checkBox1 // @@ -173,6 +174,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox2.Name = "comboBox2"; this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged); this.comboBox2.TextChanged += new System.EventHandler(this.comboBox2_TextChanged); + this.comboBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox2_KeyPress); // // label2 // @@ -192,6 +194,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox3.Name = "comboBox3"; this.comboBox3.SelectedIndexChanged += new System.EventHandler(this.comboBox3_SelectedIndexChanged); this.comboBox3.TextChanged += new System.EventHandler(this.comboBox3_TextChanged); + this.comboBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox3_KeyPress); // // label3 // @@ -211,6 +214,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox4.Name = "comboBox4"; this.comboBox4.SelectedIndexChanged += new System.EventHandler(this.comboBox4_SelectedIndexChanged); this.comboBox4.TextChanged += new System.EventHandler(this.comboBox4_TextChanged); + this.comboBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox4_KeyPress); // // label4 // @@ -230,6 +234,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox5.Name = "comboBox5"; this.comboBox5.SelectedIndexChanged += new System.EventHandler(this.comboBox5_SelectedIndexChanged); this.comboBox5.TextChanged += new System.EventHandler(this.comboBox5_TextChanged); + this.comboBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox5_KeyPress); // // label5 // @@ -249,6 +254,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox6.Name = "comboBox6"; this.comboBox6.SelectedIndexChanged += new System.EventHandler(this.comboBox6_SelectedIndexChanged); this.comboBox6.TextChanged += new System.EventHandler(this.comboBox6_TextChanged); + this.comboBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox6_KeyPress); // // label6 // @@ -268,6 +274,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox7.Name = "comboBox7"; this.comboBox7.SelectedIndexChanged += new System.EventHandler(this.comboBox7_SelectedIndexChanged); this.comboBox7.TextChanged += new System.EventHandler(this.comboBox7_TextChanged); + this.comboBox7.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox7_KeyPress); // // label7 // @@ -287,6 +294,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox8.Name = "comboBox8"; this.comboBox8.SelectedIndexChanged += new System.EventHandler(this.comboBox8_SelectedIndexChanged); this.comboBox8.TextChanged += new System.EventHandler(this.comboBox8_TextChanged); + this.comboBox8.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox8_KeyPress); // // label8 // @@ -306,6 +314,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox9.Name = "comboBox9"; this.comboBox9.SelectedIndexChanged += new System.EventHandler(this.comboBox9_SelectedIndexChanged); this.comboBox9.TextChanged += new System.EventHandler(this.comboBox9_TextChanged); + this.comboBox9.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox9_KeyPress); // // label9 // @@ -325,6 +334,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox10.Name = "comboBox10"; this.comboBox10.SelectedIndexChanged += new System.EventHandler(this.comboBox10_SelectedIndexChanged); this.comboBox10.TextChanged += new System.EventHandler(this.comboBox10_TextChanged); + this.comboBox10.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox10_KeyPress); // // label10 // @@ -344,6 +354,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox11.Name = "comboBox11"; this.comboBox11.SelectedIndexChanged += new System.EventHandler(this.comboBox11_SelectedIndexChanged); this.comboBox11.TextChanged += new System.EventHandler(this.comboBox11_TextChanged); + this.comboBox11.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox11_KeyPress); // // label11 // @@ -363,6 +374,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox12.Name = "comboBox12"; this.comboBox12.SelectedIndexChanged += new System.EventHandler(this.comboBox12_SelectedIndexChanged); this.comboBox12.TextChanged += new System.EventHandler(this.comboBox12_TextChanged); + this.comboBox12.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox12_KeyPress); // // label12 // @@ -382,6 +394,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox13.Name = "comboBox13"; this.comboBox13.SelectedIndexChanged += new System.EventHandler(this.comboBox13_SelectedIndexChanged); this.comboBox13.TextChanged += new System.EventHandler(this.comboBox13_TextChanged); + this.comboBox13.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox13_KeyPress); // // label13 // @@ -401,6 +414,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox14.Name = "comboBox14"; this.comboBox14.SelectedIndexChanged += new System.EventHandler(this.comboBox14_SelectedIndexChanged); this.comboBox14.TextChanged += new System.EventHandler(this.comboBox14_TextChanged); + this.comboBox14.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox14_KeyPress); // // label14 // @@ -420,6 +434,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox15.Name = "comboBox15"; this.comboBox15.SelectedIndexChanged += new System.EventHandler(this.comboBox15_SelectedIndexChanged); this.comboBox15.TextChanged += new System.EventHandler(this.comboBox15_TextChanged); + this.comboBox15.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox15_KeyPress); // // label15 // @@ -439,6 +454,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox16.Name = "comboBox16"; this.comboBox16.SelectedIndexChanged += new System.EventHandler(this.comboBox16_SelectedIndexChanged); this.comboBox16.TextChanged += new System.EventHandler(this.comboBox16_TextChanged); + this.comboBox16.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox16_KeyPress); // // label16 // @@ -458,6 +474,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox17.Name = "comboBox17"; this.comboBox17.SelectedIndexChanged += new System.EventHandler(this.comboBox17_SelectedIndexChanged); this.comboBox17.TextChanged += new System.EventHandler(this.comboBox17_TextChanged); + this.comboBox17.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox17_KeyPress); // // label17 // @@ -477,6 +494,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox18.Name = "comboBox18"; this.comboBox18.SelectedIndexChanged += new System.EventHandler(this.comboBox18_SelectedIndexChanged); this.comboBox18.TextChanged += new System.EventHandler(this.comboBox18_TextChanged); + this.comboBox18.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox18_KeyPress); // // label18 // @@ -496,6 +514,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox19.Name = "comboBox19"; this.comboBox19.SelectedIndexChanged += new System.EventHandler(this.comboBox19_SelectedIndexChanged); this.comboBox19.TextChanged += new System.EventHandler(this.comboBox19_TextChanged); + this.comboBox19.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox19_KeyPress); // // label19 // @@ -515,6 +534,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox20.Name = "comboBox20"; this.comboBox20.SelectedIndexChanged += new System.EventHandler(this.comboBox20_SelectedIndexChanged); this.comboBox20.TextChanged += new System.EventHandler(this.comboBox20_TextChanged); + this.comboBox20.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox20_KeyPress); // // label20 // @@ -534,6 +554,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox21.Name = "comboBox21"; this.comboBox21.SelectedIndexChanged += new System.EventHandler(this.comboBox21_SelectedIndexChanged); this.comboBox21.TextChanged += new System.EventHandler(this.comboBox21_TextChanged); + this.comboBox21.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox21_KeyPress); // // label21 // @@ -553,6 +574,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox22.Name = "comboBox22"; this.comboBox22.SelectedIndexChanged += new System.EventHandler(this.comboBox22_SelectedIndexChanged); this.comboBox22.TextChanged += new System.EventHandler(this.comboBox22_TextChanged); + this.comboBox22.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox22_KeyPress); // // label22 // @@ -572,6 +594,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox23.Name = "comboBox23"; this.comboBox23.SelectedIndexChanged += new System.EventHandler(this.comboBox23_SelectedIndexChanged); this.comboBox23.TextChanged += new System.EventHandler(this.comboBox23_TextChanged); + this.comboBox23.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox23_KeyPress); // // label23 // @@ -591,6 +614,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 this.comboBox24.Name = "comboBox24"; this.comboBox24.SelectedIndexChanged += new System.EventHandler(this.comboBox24_SelectedIndexChanged); this.comboBox24.TextChanged += new System.EventHandler(this.comboBox24_TextChanged); + this.comboBox24.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.comboBox24_KeyPress); // // label24 // diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.cs b/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.cs index 52916cf5b..ee5d7a67c 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.cs @@ -2,6 +2,7 @@ /// Copyright (c) 2015 Sensus Metering Systems /// using System; +using System.Collections.Generic; using System.Windows.Forms; using log4net; using TBF.Resources; @@ -24,6 +25,8 @@ namespace TBF.BenchControl.DataEntry.Standard24 public bool Completed { get { return completed; } } bool completed; + IList enabledComboBoxes; + /// /// Constructor /// @@ -35,6 +38,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 SNText = new string[WaterMetersCount]; Disabled = new bool[WaterMetersCount]; completed = false; + enabledComboBoxes = new List(); StartForceCloseHandler(); //Height = 147 + WaterMetersCount * 90; @@ -60,50 +64,50 @@ namespace TBF.BenchControl.DataEntry.Standard24 if (WaterMetersCount >= 4) comboBox4.Items.Add(Program.LocalSettings.LastSNTexts[3]); if (WaterMetersCount >= 5) comboBox5.Items.Add(Program.LocalSettings.LastSNTexts[4]); if (WaterMetersCount >= 6) comboBox6.Items.Add(Program.LocalSettings.LastSNTexts[5]); - if (WaterMetersCount >= 7) comboBox3.Items.Add(Program.LocalSettings.LastSNTexts[6]); - if (WaterMetersCount >= 8) comboBox4.Items.Add(Program.LocalSettings.LastSNTexts[7]); - if (WaterMetersCount >= 9) comboBox5.Items.Add(Program.LocalSettings.LastSNTexts[8]); - if (WaterMetersCount >= 10) comboBox6.Items.Add(Program.LocalSettings.LastSNTexts[9]); - if (WaterMetersCount >= 11) comboBox1.Items.Add(Program.LocalSettings.LastSNTexts[10]); - if (WaterMetersCount >= 12) comboBox2.Items.Add(Program.LocalSettings.LastSNTexts[11]); - if (WaterMetersCount >= 13) comboBox3.Items.Add(Program.LocalSettings.LastSNTexts[12]); - if (WaterMetersCount >= 14) comboBox4.Items.Add(Program.LocalSettings.LastSNTexts[13]); - if (WaterMetersCount >= 15) comboBox5.Items.Add(Program.LocalSettings.LastSNTexts[14]); - if (WaterMetersCount >= 16) comboBox6.Items.Add(Program.LocalSettings.LastSNTexts[15]); - if (WaterMetersCount >= 17) comboBox3.Items.Add(Program.LocalSettings.LastSNTexts[16]); - if (WaterMetersCount >= 18) comboBox4.Items.Add(Program.LocalSettings.LastSNTexts[17]); - if (WaterMetersCount >= 19) comboBox5.Items.Add(Program.LocalSettings.LastSNTexts[18]); - if (WaterMetersCount >= 20) comboBox6.Items.Add(Program.LocalSettings.LastSNTexts[19]); - if (WaterMetersCount >= 21) comboBox1.Items.Add(Program.LocalSettings.LastSNTexts[20]); - if (WaterMetersCount >= 22) comboBox2.Items.Add(Program.LocalSettings.LastSNTexts[21]); - if (WaterMetersCount >= 23) comboBox3.Items.Add(Program.LocalSettings.LastSNTexts[22]); - if (WaterMetersCount >= 24) comboBox4.Items.Add(Program.LocalSettings.LastSNTexts[23]); + if (WaterMetersCount >= 7) comboBox7.Items.Add(Program.LocalSettings.LastSNTexts[6]); + if (WaterMetersCount >= 8) comboBox8.Items.Add(Program.LocalSettings.LastSNTexts[7]); + if (WaterMetersCount >= 9) comboBox9.Items.Add(Program.LocalSettings.LastSNTexts[8]); + if (WaterMetersCount >= 10) comboBox10.Items.Add(Program.LocalSettings.LastSNTexts[9]); + if (WaterMetersCount >= 11) comboBox11.Items.Add(Program.LocalSettings.LastSNTexts[10]); + if (WaterMetersCount >= 12) comboBox12.Items.Add(Program.LocalSettings.LastSNTexts[11]); + if (WaterMetersCount >= 13) comboBox13.Items.Add(Program.LocalSettings.LastSNTexts[12]); + if (WaterMetersCount >= 14) comboBox14.Items.Add(Program.LocalSettings.LastSNTexts[13]); + if (WaterMetersCount >= 15) comboBox15.Items.Add(Program.LocalSettings.LastSNTexts[14]); + if (WaterMetersCount >= 16) comboBox16.Items.Add(Program.LocalSettings.LastSNTexts[15]); + if (WaterMetersCount >= 17) comboBox17.Items.Add(Program.LocalSettings.LastSNTexts[16]); + if (WaterMetersCount >= 18) comboBox18.Items.Add(Program.LocalSettings.LastSNTexts[17]); + if (WaterMetersCount >= 19) comboBox19.Items.Add(Program.LocalSettings.LastSNTexts[18]); + if (WaterMetersCount >= 20) comboBox20.Items.Add(Program.LocalSettings.LastSNTexts[19]); + if (WaterMetersCount >= 21) comboBox21.Items.Add(Program.LocalSettings.LastSNTexts[20]); + if (WaterMetersCount >= 22) comboBox22.Items.Add(Program.LocalSettings.LastSNTexts[21]); + if (WaterMetersCount >= 23) comboBox23.Items.Add(Program.LocalSettings.LastSNTexts[22]); + if (WaterMetersCount >= 24) comboBox24.Items.Add(Program.LocalSettings.LastSNTexts[23]); } - if (WaterMetersCount < 1) { label1.Visible = comboBox1.Visible = checkBox1.Visible = false; } - if (WaterMetersCount < 2) { label2.Visible = comboBox2.Visible = checkBox2.Visible = false; } - if (WaterMetersCount < 3) { label3.Visible = comboBox3.Visible = checkBox3.Visible = false; } - if (WaterMetersCount < 4) { label4.Visible = comboBox4.Visible = checkBox4.Visible = false; } - if (WaterMetersCount < 5) { label5.Visible = comboBox5.Visible = checkBox5.Visible = false; } - if (WaterMetersCount < 6) { label6.Visible = comboBox6.Visible = checkBox6.Visible = false; } - if (WaterMetersCount < 7) { label7.Visible = comboBox7.Visible = checkBox7.Visible = false; } - if (WaterMetersCount < 8) { label8.Visible = comboBox8.Visible = checkBox8.Visible = false; } - if (WaterMetersCount < 9) { label9.Visible = comboBox9.Visible = checkBox9.Visible = false; } - if (WaterMetersCount < 10) { label10.Visible = comboBox10.Visible = checkBox10.Visible = false; } - if (WaterMetersCount < 11) { label11.Visible = comboBox11.Visible = checkBox11.Visible = false; } - if (WaterMetersCount < 12) { label12.Visible = comboBox12.Visible = checkBox12.Visible = false; } - if (WaterMetersCount < 13) { label13.Visible = comboBox13.Visible = checkBox13.Visible = false; } - if (WaterMetersCount < 14) { label14.Visible = comboBox14.Visible = checkBox14.Visible = false; } - if (WaterMetersCount < 15) { label15.Visible = comboBox15.Visible = checkBox15.Visible = false; } - if (WaterMetersCount < 16) { label16.Visible = comboBox16.Visible = checkBox16.Visible = false; } - if (WaterMetersCount < 17) { label17.Visible = comboBox17.Visible = checkBox17.Visible = false; } - if (WaterMetersCount < 18) { label18.Visible = comboBox18.Visible = checkBox18.Visible = false; } - if (WaterMetersCount < 19) { label19.Visible = comboBox19.Visible = checkBox19.Visible = false; } - if (WaterMetersCount < 20) { label20.Visible = comboBox20.Visible = checkBox20.Visible = false; } - if (WaterMetersCount < 21) { label21.Visible = comboBox21.Visible = checkBox21.Visible = false; } - if (WaterMetersCount < 22) { label22.Visible = comboBox22.Visible = checkBox22.Visible = false; } - if (WaterMetersCount < 23) { label23.Visible = comboBox23.Visible = checkBox23.Visible = false; } - if (WaterMetersCount < 24) { label24.Visible = comboBox24.Visible = checkBox24.Visible = false; } + if (WaterMetersCount < 1) { label1.Visible = comboBox1.Visible = checkBox1.Visible = false; } else { enabledComboBoxes.Add(comboBox1); } + if (WaterMetersCount < 2) { label2.Visible = comboBox2.Visible = checkBox2.Visible = false; } else { enabledComboBoxes.Add(comboBox2); } + if (WaterMetersCount < 3) { label3.Visible = comboBox3.Visible = checkBox3.Visible = false; } else { enabledComboBoxes.Add(comboBox3); } + if (WaterMetersCount < 4) { label4.Visible = comboBox4.Visible = checkBox4.Visible = false; } else { enabledComboBoxes.Add(comboBox4); } + if (WaterMetersCount < 5) { label5.Visible = comboBox5.Visible = checkBox5.Visible = false; } else { enabledComboBoxes.Add(comboBox5); } + if (WaterMetersCount < 6) { label6.Visible = comboBox6.Visible = checkBox6.Visible = false; } else { enabledComboBoxes.Add(comboBox6); } + if (WaterMetersCount < 7) { label7.Visible = comboBox7.Visible = checkBox7.Visible = false; } else { enabledComboBoxes.Add(comboBox7); } + if (WaterMetersCount < 8) { label8.Visible = comboBox8.Visible = checkBox8.Visible = false; } else { enabledComboBoxes.Add(comboBox8); } + if (WaterMetersCount < 9) { label9.Visible = comboBox9.Visible = checkBox9.Visible = false; } else { enabledComboBoxes.Add(comboBox9); } + if (WaterMetersCount < 10) { label10.Visible = comboBox10.Visible = checkBox10.Visible = false; } else { enabledComboBoxes.Add(comboBox10); } + if (WaterMetersCount < 11) { label11.Visible = comboBox11.Visible = checkBox11.Visible = false; } else { enabledComboBoxes.Add(comboBox11); } + if (WaterMetersCount < 12) { label12.Visible = comboBox12.Visible = checkBox12.Visible = false; } else { enabledComboBoxes.Add(comboBox12); } + if (WaterMetersCount < 13) { label13.Visible = comboBox13.Visible = checkBox13.Visible = false; } else { enabledComboBoxes.Add(comboBox13); } + if (WaterMetersCount < 14) { label14.Visible = comboBox14.Visible = checkBox14.Visible = false; } else { enabledComboBoxes.Add(comboBox14); } + if (WaterMetersCount < 15) { label15.Visible = comboBox15.Visible = checkBox15.Visible = false; } else { enabledComboBoxes.Add(comboBox15); } + if (WaterMetersCount < 16) { label16.Visible = comboBox16.Visible = checkBox16.Visible = false; } else { enabledComboBoxes.Add(comboBox16); } + if (WaterMetersCount < 17) { label17.Visible = comboBox17.Visible = checkBox17.Visible = false; } else { enabledComboBoxes.Add(comboBox17); } + if (WaterMetersCount < 18) { label18.Visible = comboBox18.Visible = checkBox18.Visible = false; } else { enabledComboBoxes.Add(comboBox18); } + if (WaterMetersCount < 19) { label19.Visible = comboBox19.Visible = checkBox19.Visible = false; } else { enabledComboBoxes.Add(comboBox19); } + if (WaterMetersCount < 20) { label20.Visible = comboBox20.Visible = checkBox20.Visible = false; } else { enabledComboBoxes.Add(comboBox20); } + if (WaterMetersCount < 21) { label21.Visible = comboBox21.Visible = checkBox21.Visible = false; } else { enabledComboBoxes.Add(comboBox21); } + if (WaterMetersCount < 22) { label22.Visible = comboBox22.Visible = checkBox22.Visible = false; } else { enabledComboBoxes.Add(comboBox22); } + if (WaterMetersCount < 23) { label23.Visible = comboBox23.Visible = checkBox23.Visible = false; } else { enabledComboBoxes.Add(comboBox23); } + if (WaterMetersCount < 24) { label24.Visible = comboBox24.Visible = checkBox24.Visible = false; } else { enabledComboBoxes.Add(comboBox24); } } void Localize() @@ -584,5 +588,60 @@ namespace TBF.BenchControl.DataEntry.Standard24 } #endregion + + /// + /// Process a key press within any enabled text boxe + /// + /// + /// + /// TextBox control which received the event + private void ProcKeyPress(object sender, KeyPressEventArgs e, ComboBox currentFocusOwner) + { + if (e.KeyChar == '+') + { + /// Process '+' key ..... Form completed + okButton_Click(sender, e); + } + if (e.KeyChar == '\r') + { + /// Process key ..... Next text field + if (enabledComboBoxes.Count < 2) return; /// There is just one enabled textbox + + for (int i = 0; i < enabledComboBoxes.Count; i++) + { + if (enabledComboBoxes[i] == currentFocusOwner) + { + /// Change focus to the next enabled text box + enabledComboBoxes[(i + 1) % enabledComboBoxes.Count].Focus(); + return; + } + } + } + } + + private void comboBox1_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox1); } + private void comboBox2_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox2); } + private void comboBox3_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox3); } + private void comboBox4_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox4); } + private void comboBox5_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox5); } + private void comboBox6_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox6); } + private void comboBox7_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox7); } + private void comboBox8_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox8); } + private void comboBox9_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox9); } + private void comboBox10_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox10); } + private void comboBox11_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox11); } + private void comboBox12_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox12); } + private void comboBox13_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox13); } + private void comboBox14_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox14); } + private void comboBox15_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox15); } + private void comboBox16_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox16); } + private void comboBox17_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox17); } + private void comboBox18_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox18); } + private void comboBox19_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox19); } + private void comboBox20_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox20); } + private void comboBox21_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox21); } + private void comboBox22_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox22); } + private void comboBox23_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox23); } + private void comboBox24_KeyPress(object sndr, KeyPressEventArgs e) { ProcKeyPress(sndr, e, comboBox24); } } } diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.resx b/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.resx index 114e112e0..bd8aaa35a 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.resx +++ b/TestBenchFramework/BenchControl/DataEntry/Standard24/CycleBeginningForm.resx @@ -146,15 +146,6 @@ 74 - - 90, 31 - - - 260, 31 - - - 0 - orderComboBox @@ -194,6 +185,27 @@ 73 + + 90, 31 + + + 260, 31 + + + 0 + + + orderComboBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + orderGroupBox + + + 0 + Verdana, 14.25pt diff --git a/TestBenchFramework/BenchControl/DataEntry/Standard24/TestStartEndForm.cs b/TestBenchFramework/BenchControl/DataEntry/Standard24/TestStartEndForm.cs index 2ee54aeb5..5a0c7033c 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Standard24/TestStartEndForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Standard24/TestStartEndForm.cs @@ -606,7 +606,7 @@ namespace TBF.BenchControl.DataEntry.Standard24 { if (enabledTextBoxes[i] == currentFocusOwner) { - /// Change focus to teh next enabled text box + /// Change focus to the next enabled text box enabledTextBoxes[(i + 1) % enabledTextBoxes.Count].Focus(); return; }