c# - How to return answer from textbox -
i have code user inputs information textbox , want return information string can access other places in code. (subquestion - i've searched everywhere - what's name blocks of code under "private void")
private string searchjobnotextbox_textchanged(object sender, eventargs e) { string ssearchjobno = searchjobnotextbox.text; return ssearchjobno; }
your method handling textchanged
event can't return anything, should void.
also - can access textbox text anywhere in form class. if need somewhere outside form - can create public (or internal - depending on scope need access it) method (or property) returning it.
something
public string searchjobno { { return searchjobnotextbox.text; } }
then able access value yourform.searchjobno
and answer on subquestion: name blocks of code under "private void" - "method".
Comments
Post a Comment