Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / August 2004

Tip: Looking for answers? Try searching our database.

Dropdown bar: changing focus after OnItemChosen?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon Marlow - 27 Aug 2004 10:27 GMT
I've implemented dropdown bar support for my language.  The bar displays the
right entiries, and I've hooked the OnItemChosen() method to move the caret
in the text view to the right place when an item is clicked.

However, after an item is chosen in the dropdown bar, the focus remains on
the bar - the bar item is still highlighted. The bar in  VC++ doesn't do
this: focus goes back to the edit window.

So I tried SendExplicitFocus() on the IVsTextView to focus the edit window
again.  However, while this does sort of solve the problem (the cursor
re-appears in the edit window), the dropdown bar remains highlighted and the
edit window doesn't really have focus: moving the mouse wheel doesn't scroll
it, for example.

So what's the right way to re-assign focus after an item on the dropdown bar
is selected?
JC - 27 Aug 2004 12:08 GMT
I'm having the same exact problem. When I call SendExplicitFocus, the cursor
jumps to the editor but I can not type anything.

JC

> I've implemented dropdown bar support for my language.  The bar displays the
> right entiries, and I've hooked the OnItemChosen() method to move the caret
[quoted text clipped - 12 lines]
> So what's the right way to re-assign focus after an item on the dropdown bar
> is selected?
Simon Marlow - 27 Aug 2004 13:17 GMT
I found a solution: calling IVsTextManager::NavigateToLineAndColumn() instead
of  IVsTextView:SetCaretPos() does the right thing.  Not only does it move
the caret, but it highlights the selection, scrolls the window if necessary,
and does the right thing with the focus.

Cheers,
  Simon

> I'm having the same exact problem. When I call SendExplicitFocus, the cursor
> jumps to the editor but I can not type anything.
[quoted text clipped - 22 lines]
> bar
> > is selected?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.