Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a program, it populate a listbox with barcode by one one.
Konw with a a RadioFrequency Reader which reads barcodes whole of bunch.
You just connected using USB to your computer, its send the barcode number separated by ENTER to a text box.

I just want to insert those codes to the listbox or directly to the Listbox.

Any Helps?

What I have tried:

Populate a Listbox from a RadioFrequency Reader
Posted
Updated 30-Mar-21 10:01am
Comments
[no name] 30-Mar-21 15:36pm    
Hook the text box's TextChanged event.

1 solution

Add a button to your form, and set the Form.AcceptButton property to the button.
Handle the Button.Click event and transfer the TextBox.Text to your ListBox, then clear it and set the focus back to it:
C#
private void MyButton_Click(object sender, EventArgs e)
    {
    MyListBox.Items.Add(MyTextBox.Text);
    MyTextBox.Clear();
    MyTextBox.Focus();
    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900