c# - bind the button content which textbox has the cursor -
i tried create on-screen keyboard.

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
Post a Comment