ahmed salah

ahmed salah

  • NA
  • 530
  • 148.9k

how to hide textbox4 when split data ?

Feb 20 2017 4:23 PM

I work in windows form 2015

when i need to read qr code i connect scanner to computer as USB

then open my windows form and put cursor in specific text box as textbox4

and it read success

so that

How to recieve data reading from scanner to textbox4 only and split data

if  textbox 4 is hidden ? 
 
  1. private void textBox4_KeyDown(object sender, KeyEventArgs e)  
  2.        {  
  3.             
  4.                string[] lines = textBox4.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);  
  5.   
  6.            if (lines.Length > 4)  
  7.            {  
  8.                textBox1.Text = lines[1].Substring(lines[1].IndexOf(":") + 1);  
  9.                textBox2.Text = lines[2].Substring(lines[2].IndexOf(":") + 1);  
  10.                textBox3.Text = lines[3].Substring(lines[3].IndexOf(":") + 1);  
  11.                textBox5.Text = lines[4].Substring(lines[4].IndexOf(":") + 1);  
  12.            }  
 

Answers (2)