c# - displaying text property for ToolStripTextBox added rutime -
i have added menustrip
@ run time in application.
menustrip ms = new menustrip(); toolstripmenuitem mn1 = new toolstripmenuitem("&new");
i further adding textbox eventhandler keyup event.
toolstriptextbox qry = new toolstriptextbox(); qry.keyup += new keyeventhandler(tools23); public void tools23(object sender,keyeventargs e) { if(e.keyvalue ==13) { messagebox.show(the text entered in toolstriptextbox); }
how display textbox contents when event raised, since cannot access text property runtime controls added?
try this
public void tools23(object sender, keyeventargs e) { if (e.keyvalue == 13) { toolstriptextbox t = (toolstriptextbox)sender; messagebox.show("the text entered in toolstriptextbox " + t.text); } }
Comments
Post a Comment