Click here to Skip to main content
15,844,498 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to show combobox selected text data to
TextBox by line by line
Posted
Updated 3-Jan-18 23:20pm
Comments
AmitGajjar 12-Dec-12 11:31am    
what you mean by line by line ???
CHill60 12-Dec-12 12:17pm    
Do you mean that ... you would like a text box to show the selected line from a combobox as you scroll through the list?

1. Change the textBox 'Multiline' property true
2. subscribe Combobox SelectedIndexChanged events
try inserting this code
C#
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    this.textBox1.Text += Environment.NewLine + this.comboBox1.SelectedItem;
}
 
Share this answer
 
C#
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    textBox1.Text += comboBox1.SelectedItem.ToString() + "\n";
}

use RichTextBox or Multiline TextBox...
 
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