예제 #1
0
        /// <summary>
        /// Checks if the textbox value is an integer.
        /// </summary>
        /// <returns>Returns true if is an integer, false otherwise.</returns>
        bool pasteTxtCheckForInt(TextBoxPaste txt)
        {
            int readed;

            if (int.TryParse(txt.GetPastedText(), out readed))
            {
                txt.Text = readed.ToString();
                return(true);
            }
            return(false);
        }
예제 #2
0
        private void pasteCalLoc(object sender, EventArgs e)
        {
            TextBoxPaste txt = (TextBoxPaste)sender;

            if (pasteTxtCheckForInt(txt))
            {
                return;
            }
            if (pasteToXY(txtInCalLocX, txtInCalLocY, txt.GetPastedText()))
            {
                btnCalibrate.Focus();
            }
        }
예제 #3
0
        private void pasteDstLoc(object sender, EventArgs e)
        {
            TextBoxPaste txt = (TextBoxPaste)sender;

            if (pasteTxtCheckForInt(txt))
            {
                return;
            }
            if (pasteToXY(txtInDstX, txtInDstY, txt.GetPastedText()))
            {
                // If the paste was successful, perform the calculation.
                btnCalculate.Focus();
                btnCalculate.PerformClick();
            }
        }