Modify the focus on a control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to actually force a focus to change it's position? E.G TextBox.Focus.MoveRight(1); or somekind of method that can move it?

jax
 
hi jax
if it is a textbox that you want to inforce focus in certain postion on
then you can do it this way ...
first , use the select method get the postion where you want to
set the focus
eg: this.textBox1.Select(2,3); // this
will select 3 characters from the textbox starting the 2 index character
then you set the focus to the text box
eg:this.textBox1.Focus();// set the focus
"to the selected characters" inside the textbox
hope this answer your question
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top