how to clear text from a listBox in C# VS2008 forms application
-
I think I found the MSDN page to add text, but I need to clear it first.
listBox1.Items.Add(((TextBox)sender).Text);
-
I think I found the MSDN page to add text, but I need to clear it first.
listBox1.Items.Add(((TextBox)sender).Text);
Here's a hint. Try and break the problem down. If I were you, I'd be thinking along the lines "I know - I need to clear some items from this collection, so I have an Items collection. Now, what could the method be to clear things from Items?"
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
Here's a hint. Try and break the problem down. If I were you, I'd be thinking along the lines "I know - I need to clear some items from this collection, so I have an Items collection. Now, what could the method be to clear things from Items?"
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.