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


.
 
Back
Top