Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have designed a windows application form in C# with a text box and in another windows application form that has to got displayed. any options.

What I have tried:

I have no idea to write the code can you guide me
Posted
Updated 3-Nov-19 20:43pm
v2

1 solution

You could do it using the TextBox KeyDown event like this:
private void textbox1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Enter)
    {
        combobox1.Items.Add(textbox1.Text);
    }
}

for more information, see: https://www.dotnetperls.com/textbox[^]
 
Share this answer
 
v2

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