TextBox Problems

  • Thread starter Thread starter Travis
  • Start date Start date
T

Travis

Please excuse my ignorance but I am trying to take text from one text box
and display it in anohter like so:


SearchResults.Text = TextToSearchFor.ToString();

but I get back this display if I enter "test"


System.Windows.Forms.TextBox, Text: test


How do I get rid of the System.Windows portion and ONLY display the results
"test"

help

Travis
 
Your problem is that you are not using the Text property of the source text
box to assign the value to the target text box. i.e. you should have:

SearchResults.Text = TextToSearchFor.Text.


The ToString method "converts" the class to a string which is not what you
want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top