textbox cursor position
-
Hi, i have 2 textboxes txt1 and txt2 and a button(mybutton) which inserts variables into my textboxes. problem: i enter text into txt1 eg "my name is " and click on mybutton to enter a variable so that my variable appears right after the text i entered eg "my name is xVariable_namex". how do i let my button know which textbox it needs to enter the variable,in other words where the cursor position is. remember i have two textboxes hope you understand my question thanks for your help;) regards paula
-
Hi, i have 2 textboxes txt1 and txt2 and a button(mybutton) which inserts variables into my textboxes. problem: i enter text into txt1 eg "my name is " and click on mybutton to enter a variable so that my variable appears right after the text i entered eg "my name is xVariable_namex". how do i let my button know which textbox it needs to enter the variable,in other words where the cursor position is. remember i have two textboxes hope you understand my question thanks for your help;) regards paula
-
Hi, i have 2 textboxes txt1 and txt2 and a button(mybutton) which inserts variables into my textboxes. problem: i enter text into txt1 eg "my name is " and click on mybutton to enter a variable so that my variable appears right after the text i entered eg "my name is xVariable_namex". how do i let my button know which textbox it needs to enter the variable,in other words where the cursor position is. remember i have two textboxes hope you understand my question thanks for your help;) regards paula
I'm not sure I understood well, but if you want to add the content of a variable to the textbox that contains some string, these should be helpful: check if your control has focus: control.Focused check if your textbox has some text in it: textbox.Text.Lenght textbox.Text != string.Empty appends new text to existing text: textbox.Text += "your new text";