private void eTargetPosition_Leave(object sender, EventArgs e) { if (Motif == null) { eTargetAminoAcid.Text = ""; return; } keyPosition = 0; keyAA = ' '; if (Int32.TryParse(eTargetPosition.Text, out keyPosition)) { if (keyPosition <= 0 || keyPosition > Motif.PeptideLength) { MessageBox.Show("The target position should be within the length of the motif.", Analyzer.ProgramName); } if (keyPosition > 0) { keyAA = Motif.GetKeyChar(keyPosition - 1); } } eTargetAminoAcid.Text = keyAA.ToString().Trim(); }