HighTechTalks DotNet Forums  

Showing Caret on a richtextbox in main window behind

CSharp microsoft.public.dotnet.languages.csharp


Discuss Showing Caret on a richtextbox in main window behind in the CSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Sean
 
Posts: n/a

Default Showing Caret on a richtextbox in main window behind - 07-02-2004 , 01:21 AM






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

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.