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.
 
Back
Top