SetFocus() does not work

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

Hi all,

I am having problem setting the focus on a rcihTextBox.
The CanFocus returned false.

Any idea/suggestion to make the SetFocus work would be
greatly appreciated.

Thank you in advance.


regards,
Sean
 
* "Sean said:
I am having problem setting the focus on a rcihTextBox.
The CanFocus returned false.

Any idea/suggestion to make the SetFocus work would be
greatly appreciated.

Are you sure the control is visible and enabled?
 
Hi Sean,

CanFocus return false if the control is not visible. that's why you cannot
use Focus method in the form constructor. If you want to use it there set
the rich edit as an active control in the Form.ActiveControl property.
 
Hi Stoitcho,

Thank you so much for your help.
That's exactly what I want! :)


regards,
Sean
-----Original Message-----
Hi Sean,

CanFocus return false if the control is not visible. that's why you cannot
use Focus method in the form constructor. If you want to use it there set
the rich edit as an active control in the Form.ActiveControl property.

--
HTH
Stoitcho Goutsev (100) [C# MVP]


Hi all,

I am having problem setting the focus on a rcihTextBox.
The CanFocus returned false.

Any idea/suggestion to make the SetFocus work would be
greatly appreciated.

Thank you in advance.


regards,
Sean


.
 

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