read from textbox

Status
Not open for further replies.

william

Journeyman
friends i am doing C#. I want to know how to get or store data entered by the user in a text box.
suppose you store data entered by the user in one variable and then use that variable to display the message and the same text.
pls help
 

gaurav_indian

CG Artist
Suppose you get the value(number) from the user in textbox1.text
then declare a variable

int a;

a=int.Parse(textbox1.text);

also place a label named label1 on the form
then
label1.text=a.toString();

I hope this will help.
 

sakumar79

Technomancer
^^ Note that the command label1.text=a.toString() should be placed within event handler for textbox text change... On the other hand, you can also write for focus leaving the textbox...

Arun
 
Status
Not open for further replies.
Top Bottom