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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -