how to copy all data from richtexbox to listbox
The idea is I have this richtetxbox that I populate with some data and format
I want every item in the rich textbox on a button_click event to be transfered from richtetxbox to listbox .Any guidance is welcome.
thanks
Loading

VulpesPosted Feb 23, 2015, 10:56 AM
private void button1_Click(object sender, EventArgs e)
{
if (richTextBox1.Text.Length > 0)
{
listBox1.Items.AddRange(richTextBox1.Lines);
}
}
It's also assumed that, if there are existing items in the ListBox, these will be added to, not overwritten.
Ekona PikinPosted Feb 23, 2015, 12:04 PM