473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

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

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
1 2205
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: cc | last post by:
Hi, Is possible set and get the caret position of cursor in a text field ? Thanks, Carlo
3
by: ozbear | last post by:
The title says it all. Since a Richedit control doesn't understand a backspace character ('\b', or 0x08) when I receive one I need to programmatically delete the last character from the Richedit...
5
by: Brian Link | last post by:
The design of my app is such that I have a main form which loads a variety of user controls. Sometimes these controls will contain their own constituent sub-controls. The main form should...
2
by: gsb58 | last post by:
Hi! I'm new to VB.NET Anybody that could show me how to find the cursor position in a RichEdit? That is: when user click anywhere in the box and there's some text already, I want to...
1
by: dBNovice | last post by:
Please help! I have 3 forms: Task, Subtask, Elements. Elements is a subform of Subtask and Subtask is a subform of Task. I am able to navigate from Task to Subform to Element and from Element to...
5
by: Charlie Brown | last post by:
I am using the following to load my mdi form into the parent. If Me.frmIncoming Is Nothing Then Me.frmIncoming = New IncomingForm Me.frmIncoming.MdiParent = Me End If Me.frmIncoming.Show()...
4
by: roxanaislam | last post by:
Submitting Form by pressing the "ENTER" key -------------------------------------------------------------------------------- Hi: I have a search form in my application which has 4 dropdown...
16
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
1
by: Warren Tang | last post by:
Hello everyone The caret I mean is the flashing vertical line that indicates where the next character will be inputed in a text editor. It's not the mouse cursor. Don't you feel it's hard to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.