473,385 Members | 1,370 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,385 software developers and data experts.

Showing Caret on a richtextbox in main window behind

Hi,

I have an application that will pop up a listboxwindow
(containing words that users can choose from)
when I type certain characters on a richtextbox.

Now I have a problem of maintaining the caret at the
richtextbox, because once the listboxwindow pops up, the
input focus will move to the listboxwindow.

How can I make the caret stay at the richtextbox?

I tried the following but it didn't work:

if(m.Msg == WM_NCACTIVATE)
{
if (((int) m.WParam) == 0)
{
SendMessage(this.Handle, WM_NCACTIVATE, 1,
IntPtr.Zero);
SendMessage(this.Handle, WM_SETFOCUS, 1,
IntPtr.Zero);
CreateCaret(this.Handle, IntPtr.Zero, 0, 0);
ShowCaret(this.Handle);
}
}

Any idea would be appreciated.
Thank you in advance. :)
regards,
Sean
Nov 16 '05 #1
0 1076

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: - ions | last post by:
hi, i am in the procces of writing a chat program for a main Assigment, the problem im stuck on is one of the Carets position in a JTextArea, when i hit the enter key, it appends the msg to the...
2
by: Sean | last post by:
Hi, I have an application that will pop up a listboxwindow (containing words that users can choose from) when I type certain characters on a richtextbox. Now I have a problem of maintaining...
6
by: kurotsuke | last post by:
Hi, I need to know the position (X, Y cohordinates) of the caret. I'm using the function: private static extern int GetCaretPos(ref POINT lpPoint); I'm actually getting a result but I...
0
by: James dean | last post by:
In this program i set the RichTextBox property SelectionStart in order to move the caret(cursor) onto the next character. I have a loop to do this but unfortunately this is very slow. How would i...
2
by: DaveR | last post by:
Can anybody help me to a)get the user's cursor insertion point (caret) from a multiline textbox, using client-side script I suppose, and then b)return the position to VB code behind? I have...
2
by: randy | last post by:
Hi, I'm trying to set up a richtextbox to behave like the text area in a web browser, i.e. no caret, and a cursor that changes depending on what it's hovering over. I've been setting the...
0
by: Udi | last post by:
Hi, I have derived my ConsoleTextBox from RichTextBox. I'm trying to implement a console-like text box with history capabilities. My problem is that when I'm trying to append a command, I can't...
1
by: Claire | last post by:
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...
0
Jezternz
by: Jezternz | last post by:
Okay, so a while back I managed to retrieve it correctly. In this thread: http://bytes.com/topic/javascript/answers/786211-retrieving-caret-start-end-values#post3127765 However I have found...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.