c# - bind the button content which textbox has the cursor -


i tried create on-screen keyboard.

enter image description here

here want bind button content, textbox has cursor.

public partial class current_cursor : window {     public current_cursor()     {         this.initializecomponent();           }      private void btn_a_click(object sender, routedeventargs e)     {         txt_diplay_1.text += btn_a.content;     }  } 

with above code can bind button content in first textbox.

but can't bind value in textbox.

please me.

this implementation in wpf:

<textbox height="23" margin="30,28,128,0" name="textbox1" verticalalignment="top" gotfocus="textbox1_gotfocus" /> <textbox height="23" margin="58,86,100,0" name="textbox2" verticalalignment="top"  gotfocus="textbox2_gotfocus"/> 

backend:

 control ctrl = null;     private void button1_click(object sender, routedeventargs e)     {         if (ctrl != null)         {             textbox tb = ctrl textbox;             tb.text += convert.tostring(button1.content);         }     }       private void textbox2_gotfocus(object sender, routedeventargs e)     {         ctrl = (control)sender;     }      private void textbox1_gotfocus(object sender, routedeventargs e)     {         ctrl = (control)sender;     } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -