How do I keep main form richedit caret flashing when pressing button in 2nd form

C

Claire

I'm writing an application with custom skinned controls.
I have a text editor form with a rich edit control. Because there's no
toolbuttons in the skinned control set, I have to use normal ones for
Bold/Italic/Underline etc. Because they're normal buttons, they grab focus
from the rich edit. So to prevent losing the caret Ive used the Validating
event to cancel focus loss. This works great.
The application can be run in either terminal or desktop mode.
In terminal mode ie no physical keyboard, I have had to write a small
keyboard window to allow the user to enter text/symbols.
When I switch to the 2nd form, the rich edit is still the ActiveControl on
the main form but the caret vanishes from view.

Am I able to do anything similar here? The keypad window needs to behave in
the same way they do in compact framework.

thanks
 
P

pigeonrandle

Hi,

You could try passing a reference of your rich edit to your 2nd form
and then calling RichEdit.Focus() when one of your form2 buttons is
clicked? I suspect that if that works, you will find form 2 loses focus
so users will have to double click a button on form2 to get it to fire
a click event (once to give focus to form2 and another to click the
button).

You could also created an inherited RichEdit that displays the caret
whether it has focus or not. Im sure there's an API to draw a caret.

The problem you face is the fact that the caret indicates where data is
being entered, and clicking on something else means you are setting
input to another control.

Sorry i couldn't help more.

James Randle.
 

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

Top