private void ClearOneByteButton_Click(object sender, EventArgs e) { if ((RemainingNum > 0) && (RemainingNum != BytesNum)) { Array.Copy(buf, 0, buf, 0, buf.Length - 1); MsgScintilla.ReadOnly = false; MsgScintilla.Undo(); MsgScintilla.ReadOnly = true; RemainingNum += 1; BytesLeftLabel.Text = RemainingNum.ToString(); HexInput.Controls[1].Text = ""; HexInput.Focus(); } }
private void InputByteButton_Click_1(object sender, EventArgs e) { if (RemainingNum > 0) { buf[BytesNum - RemainingNum] = (byte)HexInput.Value; RemainingNum--; MsgScintilla.ReadOnly = false; MsgScintilla.BeginUndoAction(); if (count % 8 == 0) { MsgScintilla.AppendText(((int)HexInput.Value).ToString("X") + "\r\n"); count = 1; } else { count++; MsgScintilla.AppendText(((int)HexInput.Value).ToString("X") + " "); } MsgScintilla.EndUndoAction(); MsgScintilla.ReadOnly = true; BytesLeftLabel.Text = RemainingNum.ToString(); HexInput.Value = 0; if (RemainingNum == 0) { InputPanel.Visible = false; EndInputButton.Visible = true; } HexInput.Focus(); HexInput.Controls[1].Text = ""; } else { InputPanel.Visible = false; EndInputButton.Visible = true; } }