By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,694 Members | 1,882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,694 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jan 16 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
Claire wrote:
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
Jan 16 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.