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