We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Cursor in a non-focused RichTextBox

Hi All,

Can I show input cursor in a non-focused RichTextBox?

In my project, I have a RichTextBox and a ListView control. The focus should be on ListView control. I could handle the KeyPress and KeyDown events of ListView and re-directed to RichTextBox to enable typing. But how can I show cursor on RichTextBox.

RichTextBox.focus() cann't be called. The focus must be in ListViewControl (like combobox ). Any Idea....?

2
Contributors
3
Replies
2 Days
Discussion Span
3 Months Ago
Last Updated
16
Views
NidhiSree
Newbie Poster
15 posts since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

You don't need to put the cursor back into the text box. Simply intercept the key being pressed in your keydown/up and update the string in your textbox with the new character. You may need to call refresh on your textbox control afterwards.

Ketsuekiame
Nearly a Posting Virtuoso
1,204 posts since May 2010
Reputation Points: 553
Solved Threads: 154
Skill Endorsements: 9

Yes I did it. I can intercept the key press events in Listview to textbox. But I need to show the cursor in textbox when the ListView has the focus. How....?

NidhiSree
Newbie Poster
15 posts since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Why do you need to show the cursor in the box? I think without override the OnPaint event, you won't be able to.

Ketsuekiame
Nearly a Posting Virtuoso
1,204 posts since May 2010
Reputation Points: 553
Solved Threads: 154
Skill Endorsements: 9

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0609 seconds using 2.65MB