From: Ryan Ross on
Hello All,

I have a small problem. I have a RichTextBox, which calls a
ContextMenuStrip, when a user types certain text. The problem I am
faced
with is that I cannot return the focus (keyboard input, etc.) to the
RichTextBox, once the ContextMenuStrip opens.

When the ContextMenuStrip opens, I'd like the keyboard input to
continue for
the RichTextBox.

Does anyone know how to accomplish this task?

Thanks,
Ryan

From: Jeff Gaines on
On 23/10/2009 in message <igf3e5pf53q3p0m6ohendfb0jk19caeelc(a)4ax.com> Ryan
Ross wrote:

>Hello All,
>
>I have a small problem. I have a RichTextBox, which calls a
>ContextMenuStrip, when a user types certain text. The problem I am
>faced
>with is that I cannot return the focus (keyboard input, etc.) to the
>RichTextBox, once the ContextMenuStrip opens.
>
>When the ContextMenuStrip opens, I'd like the keyboard input to
>continue for
>the RichTextBox.

That might make it a bit difficult for a user to select an item from the
menu...

>Does anyone know how to accomplish this task?

It's not really how menus are supposed to work.

--
Jeff Gaines Dorset UK
640k ought to be enough for anyone.
(Bill Gates, 1981)
From: Jeff Johnson on
"Ryan Ross" <Ryan.Wayne.Ross.MCSE(a)gmail.com> wrote in message
news:igf3e5pf53q3p0m6ohendfb0jk19caeelc(a)4ax.com...

> I have a small problem. I have a RichTextBox, which calls a
> ContextMenuStrip, when a user types certain text. The problem I am
> faced
> with is that I cannot return the focus (keyboard input, etc.) to the
> RichTextBox, once the ContextMenuStrip opens.
>
> When the ContextMenuStrip opens, I'd like the keyboard input to
> continue for
> the RichTextBox.

Why? Seriously, WHY?

> Does anyone know how to accomplish this task?

No, nor do I hope it's possible. When a menu appears it should have focus.
If it loses focus it should disappear. That's what menus do. It sounds like
you want a floating toolbox-like window which contains commands. If so, make
one. Do not try to force the square menu into the round hole you're looking
for.


From: Ryan W. Ross on
Hmm.

You've used Visual Studio, right? You know how everyone likes Intellisense?
Same idea here. Intellisense is nothing more than a ContextMenuStrip (or
something akin to it), which pops up when you are typing in a text editor
(well, IDE, but you understand what I am getting at here). In short, I am
attempting to replicate some Intellisense functionality for an application
I'm developing.

You can continue typing in the text editor even when the ContextMenuStrip is
open. Perhaps I am misusing the word focus here, but I believe I have now
conveyed what I am after.

Thanks,
Ryan

BTW, does this newsgroup allow posting of images (screenshots?). I tried to
send a post with a screenshot earlier, and it hasn't appeared...

"Jeff Johnson" <i.get(a)enough.spam> wrote in message
news:urKXPOBVKHA.220(a)TK2MSFTNGP02.phx.gbl...
> "Ryan Ross" <Ryan.Wayne.Ross.MCSE(a)gmail.com> wrote in message
> news:igf3e5pf53q3p0m6ohendfb0jk19caeelc(a)4ax.com...
>
>> I have a small problem. I have a RichTextBox, which calls a
>> ContextMenuStrip, when a user types certain text. The problem I am
>> faced
>> with is that I cannot return the focus (keyboard input, etc.) to the
>> RichTextBox, once the ContextMenuStrip opens.
>>
>> When the ContextMenuStrip opens, I'd like the keyboard input to
>> continue for
>> the RichTextBox.
>
> Why? Seriously, WHY?
>
>> Does anyone know how to accomplish this task?
>
> No, nor do I hope it's possible. When a menu appears it should have focus.
> If it loses focus it should disappear. That's what menus do. It sounds
> like you want a floating toolbox-like window which contains commands. If
> so, make one. Do not try to force the square menu into the round hole
> you're looking for.
>

From: Jeff Johnson on
"Ryan W. Ross" <Ryan.Wayne.Ross.MCSE(a)gmail.com> wrote in message
news:A6E956E0-DC15-484C-97C8-C43591CD44C0(a)microsoft.com...

> You've used Visual Studio, right? You know how everyone likes
> Intellisense? Same idea here. Intellisense is nothing more than a
> ContextMenuStrip (or something akin to it), which pops up when you are
> typing in a text editor (well, IDE, but you understand what I am getting
> at here). In short, I am attempting to replicate some Intellisense
> functionality for an application I'm developing.
>
> You can continue typing in the text editor even when the ContextMenuStrip
> is open. Perhaps I am misusing the word focus here, but I believe I have
> now conveyed what I am after.

It's not a menu; it's a specialized control that kind of looks like a menu.
Look at it closer: it really looks a lot more like a floating combo box (the
dropdown portion only, not the stuff at the top). Since the little sucker is
really sensitive to focus changes I can't use Spy++ to tell what it really
is, but I can assure you it's not a menu. And if you've ever seen VB's
version of it it even has tabs at the bottom. Totally custom control.

> BTW, does this newsgroup allow posting of images (screenshots?). I tried
> to send a post with a screenshot earlier, and it hasn't appeared...

It's generally considered rude to post a binary to a group that doesn't have
".binaries." in its name, so it's probably a good thing that you couldn't
post. The next best thing is to put it on the Web somewhere and put a link
to it in your post.