.NET Framework - ContextMenuStrip steals focus?

Asked By Ryan Ross
23-Oct-09 10:32 AM
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
Visual Studio
(1)
RichTextBox
(1)
VB
(1)
ContextMenuStrip
(1)
MessageOK
(1)
Saver.Regards
(1)
Dorset
(1)
Gates
(1)
  Jeff Gaines replied...
23-Oct-09 11:29 AM
That might make it a bit difficult for a user to select an item from the
menu...


it is not really how menus are supposed to work.

--
Jeff Gaines Dorset UK
640k ought to be enough for anyone.
(Bill Gates, 1981)
  Jeff Johnson replied...
23-Oct-09 03:03 PM
Why? Seriously, WHY?


No, nor do I hope it is 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 are looking
for.
  Ryan W. Ross replied...
23-Oct-09 08:48 PM
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 am 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 has not appeared...
  Jeff Johnson replied...
23-Oct-09 09:42 PM
it is not a menu; it is 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 cannot use Spy++ to tell what it really
is, but I can assure you it is not a menu. And if you have ever seen VB's
version of it it even has tabs at the bottom. Totally custom control.


it is generally considered rude to post a binary to a group that does not have
post. The next best thing is to put it on the Web somewhere and put a link
to it in your post.
  Jeff Gaines replied...
24-Oct-09 04:44 AM
On 24/10/2009 in message


OK, understood now :-)

The Code Project is a good place to look, for example:
http://www.codeproject.com/KB/edit/codetextbox.aspx

There are other examples there as well if you search their site.

--
Jeff Gaines Dorset UK
That's an amazing invention but who would ever want to use one of them?
(President Hayes speaking to Alexander Graham Bell on the invention of the
telephone)
  Ryan W. Ross replied...
25-Oct-09 12:05 PM
Thank You ever so much. You are a life saver.

Regards,
Ryan
  Ryan W. Ross replied...
25-Oct-09 12:07 PM
Thank You for your assistance.

-Ryan
Create New Account
help
Foren nutzen. Spamschutz? Hier gab es doch so gut wie keinen Spam. Schade! MfG Susann VB - German Discussions Microsoft Word (1) Windows Server (1) Windows Vista (1) STUDIO one (1) Outlook (1) Office (1) Linux (1) Excel (1) Hallo, *Susann Markward* schrieb am m?ssen uns jetzt nicht durch den ganzen .Net Salat durchw?hlen, um die die VB-Calssic Beitr?ge lesen zu k?nnen. Gru? W. Wolf Hallo, *Horst Heinrich Dittgens* schrieb will. Mal sehen wann wir Deutschen wirklich dran sind. Ich habe mir mal die bestehenden VB-Foren angesehen, die sind exklusiv f?r VB.Net. Ein Forum darf sich am Rande mit VB6 besch?ftigen, es soll bei der Migration zu VB.Net unterst?tzen. Ob M$ neue Foren f?r VB6 und fr?her einrichtet? Die Glaubt Ihr wirklich, dass M$ f?r VB6 noch Personal bereitstellt? Man wird eher die VB Classic NGs sang- und klanglos einstellen. Ganz besonders fremdsprachliche Gruppen mit geringem Verkehr. Die gro laengerfristig hohem Postigaufkommen laesst sich aber eine Basic bzw. VisualBasic-NG einrichten): microsoft.public.de.vb - -> de.comp.lang.misc microsoft.public.de.vb.datenbank - -> de.comp.datenbanken.misc - -> de.comp
Terminus allseits bekannt ist - deshalb hoffe ich, dass es an der Stelle keine großartigen Olaf VB - German Discussions Windows Server (1) Visual Studio (1) Outlook (1) Linux (1) Excel (1) BackgroundWorker (1) W. Wolf (1) VB NET (1) Schmidt <sss@online.de> schrieb im Beitrag Gerade wegen der positiven Stimmen würde ich bei '[VB6]' bleiben (besser noch nur '[VB]'; es unterscheidet von allem bis auf VB.NET, und dafür sollte dann, denke ich, '[VBNET]' verwendet werden). '[VBclassic]' ist m.E. zu Gruppennamen: de.comp.lang.vbclassic de.comp.lang.vbdotnet . . .jetzt folgendes vor: de.comp.lang.vb de.comp.lang.vbnet Meiner Meinung nach sollten wir uns dann aber nicht wundern, wenn vor allem die VB.NET-Newcomer dann zuerst bei uns "anklopfen" . . . so sehr mir der Grund- gedanke dahinter: (ein
effective apps in vb6, I am trying to see if it is worthwhile relearning for vb.net. I have vb express 2008. One of the things I want to do is read old legacy random object. How can I do it in dot.net? How can I do this is vb.net? VB.NET Discussions Visual Studio 2010 (1) Visual Studio (1) Silverlight (1) Windows 7 (1) Office (1) Vista (1) Linux (1) Error (1) HI
oder anderen MS-NGs arbeiten will. Anhand anderer NGs wie z.B. microsoft.public.de.vb, die MS vor ca. 1 Monat von den MS-Newsservern entfernt hat, konnte festgestellt werden Andere Teilnehmer hier haben vielleicht noch andere Empfehlungen? - - Thorsten Albers albers (a) uni-freiburg.de VB.NET - German Discussions Office 2003 (1) Office (1) SortedList (1) VB.NET (1) VBA (1) VB (1) EMail Client (1) Visual (1) Hallo Thorsten, Soweit ich das mitbekommen habe, hat bisher nur Alexander Bartolich (albasani.net lang.misc hei?en, um Kritikern die Umzungswilligkeit zu zeigen und die Einrichtung einer *gemeinsamen* VB Gruppe zu f?rdern. Ich hoffe ja, dass Ingos eingereichter RfD dies vorsieht. Die Nutzung wenig Reaktion von hier. Eigneltich haben so wirklich nur die reagiert, die (scheinbar) sowohl in VB.classic wie auch in VB.net unterwegs sind. Aufgrund des scheinbaren Desinteresses der Regulars hier habe ich VB.net nicht
bei jedem neustart, was ist da faul ? Danke für Hinweise Karsten Schulz VC - German Discussions Visual Studio 2008 (1) Visual Studio (1) Office (1) CorrectSpellT (1) SPMicrosoft (1) Directories (1) Heritage® (1) Houghton (1) Hallo Karsten of Programming FAQ: http: / / www.mpdvc.de Samples: http: / / www.codeproject.com Hi Martin, Microsoft Visual Studio 2008 Version 9.0.30729.1 SP Microsoft .NET Framework Version 3.5 SP1 Installed Edition: Enterprise Microsoft Visual Basic 2008 91899-270-6248762-60410 Microsoft Visual Basic 2008 Microsoft Visual C# 2008 91899-270-6248762-60410 Microsoft Visual C# 2008 Microsoft