Example #1
0
        }// end function 'port_dataReceived'

        // this, hopefully, will prevent cross threading.
        private void displayTextReadIn(string ToBeDisplayed)          //wyswietlanie sygnalu na drugim texboxie
        {
            if (RCVbox.InvokeRequired)
            {
                RCVbox.Invoke(accessControlFromCentralThread, ToBeDisplayed);
            }
            else
            {
                RCVbox.Text = ToBeDisplayed;
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //    int errorcode = 0;
            //    port.Close();
            //Application.Restart();
            textBox2.Clear();
            RCVbox.Clear();
            flaga            = false;
            label1.Text      = "Zeskanuj barcode";
            label1.BackColor = DefaultBackColor;

            wyjscie = true;
            //     Application.Restart();
            //     Environment.Exit(errorcode);
            textBox2.ReadOnly = false;
            textBox2.Select();
        }