Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add-in problem - getting CodePane to fire activate

Status
Not open for further replies.

handbrake

Programmer
Oct 1, 2002
11
0
0
GB
Writing an add-in for personal interest which finds some text in the current project etc and highlights it for the user.

My problem is that the VBIDE.CodePane.Show method does not 'activate' the window if it is already displayed. What this then means is that if I do an oCodePane.SetSelection, the highlighted text is not visible until the user clicks on the window title.

I cannot use FindWindow to get a handle as that does not appear to work on the VB IDE Code Pane windows, not does the object model expose an hwnd - so using the WinAPI to force the window active doesn't appear to be an option.

The only time it does work is if the code pane I want to .Show is not already displayed (ie. it's visible property is false or another code pane is active). So my current workaround involves either of those options which unfortunately of course results in a flickering display.

Any ideas anyone?
Many thanks,
Grant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top