c# - How do you pass object data into textboxes in a second form to edit? -
i relatively new c# , use getting on hurdle. have windows form along classes create call objects values entered user , add them list. take existing call , display values in different text boxes in seperate form opened when click button. have 'findcall' method finds desired call in list 'callername' , 'phonenumber' values. if call found display edit form. works fine , form opens, know code find call functioning properly. cannot wrap head around how can display values of call object in text boxes on edit form. appreciated.
thanks
a simple way create property on second form. allow set values on form before displaying , new values afterwards.
on edit form have like...
string somevalue { { return somevaluefield.text; } set { somevaluefield.text = value; } }
...where somevaluefield
textbox on edit form.
then in calling form can access textbox via property...
var editform = new editform(); editform.somevalue = "..."; editform.showdialog(); var newvalue = editform.somevalue;
Comments
Post a Comment