Gustavo

Gustavo

  • NA
  • 1.3k
  • 454.4k

How Do I: Get the text value from the ((TextBox)sender)?

May 5 2010 10:38 AM

Hello:
 
I am writing my own validation routine and I need to get some information from the TextBox that I am coming from.
 
I am using: ((TextBox)sender).Name.ToString()   To get the name of the TextBox.
Is there a way to get the Text Value of the TextBox? I know if I do a: ((TextBox)sender)  It will give me: "System.Windows.Forms.textBox, Text: Company"    The Value that I want is the "Company". I guess it I can parse it and get it, but is there a simpler way like the: ((TextBox)sender).Name.ToString() ?
 
 

Answers (3)