c# - How to send a click from a form to a form -
c# - How to send a click from a form to a form -
i have windows-mobile programme has 2 forms.
in form1, have textbox , in form2, have 5 buttons.
how when press buttons in form2 i'll see them on textbox in form1
create public property on form allow calling form access chosen value.
public partial class selectionform : form { public selectionform() { initializecomponent(); } //selection holder private string _selection; //public access item public string selection { { homecoming _selection; } } private void button1_click(object sender, eventargs e) { _selection = "one selected"; this.close(); } private void button2_click(object sender, eventargs e) { _selection = "two selected"; this.close(); } } then calling form can obtain value before form disposed.
public partial class textform : form { public textform() { initializecomponent(); } private void btnselect_click(object sender, eventargs e) { using (selectionform selectionform = new selectionform()) { selectionform.showdialog(); txtselection.text = selectionform.selection; } } } c# windows-mobile
Comments
Post a Comment