473,668 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2219
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
9350
by: cc | last post by:
Hi, Is possible set and get the caret position of cursor in a text field ? Thanks, Carlo
3
4012
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 control. This is a WinForms application, not a webform. I have tried... re.SelectionLength = 1; re.SelectionStart = re.Textlength-1; re.SelectionText = ""; // empty string
5
3441
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 respond to changes in the constituent controls, either by showing/hiding menus, or updating status bar text. Currently I'm rippling up events through the usercontrols back to the main form. This is proving more and more cumbersome. In VB6, I could...
2
2805
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 programatically move to a new line and insert time, make a new line and user will be ready to insert new text.
1
3393
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 Subtask to Task by pressing a button that makes each subform invisible/visible. The problem exists when I try to navigate from Element to Task to Subtask. Sub-subform Element will become invisible and show Task but when I press the button to go...
5
5613
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() Me.frmIncoming.Location = New Point(10, 450) When the forms Show() method is called and before the location is
4
3874
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 list controls, one text box, one "GO" button, one "reset" button. When the "GO" button is clicked the form gets submitted and the results page is displayed. When I press the "enter" key nothing happens. I want to submit the form by pressing the "enter"...
16
2861
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 ass and the app will be used internally so I'm not too worried about users who aren't using javascript. I'm using the following javascript to detect whether or not they've hit enter: if(document.layers) {
1
1006
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 find the caret? How can we locate it easily in the source code? Regards Warren
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8802
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8586
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.