VSPackage Builder search dialogue - visual-studio-2010

I'd like to add a search dialogue popup, really just a text box or something at the top right of the current document. I've messed around with the VSPackage builder and it's easy enough, but I'm having trouble finding out which UI elements I should be looking at.
A ToolWindow doesn't quite fit I don't think -- I'd like what I'm doing to be borderless. I tried just using a custom WPF window by itself but that doesn't play well with the IDE.

It sounds what you're after is an editor viewport adornment.
This is a type of extension that has a class inherited from Microsoft.VisualStudio.Text.Editor.IWpfTextViewCreationListener
To create an adornment, you can use the Editor Viewport Adornment project template under Visual C#\Extensibility.
Try this example:
http://www.codeproject.com/Articles/55196/Code-InfoBox-Visual-Studio-Extension-VSX-2010

Related

Is it possible to display custom icon in Visual Studio status bar

I am aware of displaying custom text in Visual Studio status bar using IVSStatusBar interface. I have even blogged about it.
However, I have requirement to display custom icon on the Visual Studio status bar. Similar to what Resharper does to display solution errors. On clicking the icon, it also pops-up a context menu.
So, How can I display a custom icon in Visual Studio status bar, and if possible display a menu also on clicking it?. An example will help.
The Animation method of IVSStatusBar already display icons, but uses predefined icons defined in Constants. Is it possible to have custom icons and pass to Animation method?
On exploring the SDK, I found that IVSStatusBarUser interface can be used to display custom information when the window implementing that interface is displayed. But I am not sure whether that interface can be used to display custom icon.
There is no published API for that kind of status bar extensibility. In one of my own extensions (PerfWatson Monitor), I locate the status bar element by searching the WPF visual tree, using a recursive search and VisualTreeHelper, descending from Application.Current.MainWindow looking for the resize gripper in the bottom right - a child element with the Name property set to
"ResizeGripControl". When I've found the gripper, I look at its parent (it should be a DockPanel) and insert my control in there. Note that, as your screenshot shows, Resharper is known to employ a similar trick, so you'll have to come up with a strategy that works with and without Resharper installed. Also note that some pieces of the status bar (the text, the line/col information and any animations) run in their own UI thread, so be careful if your control ends up there.
I notice you also ask about extending the existing animations. Yes, you can supply your own animations via a bitmap strip of 16x16 frames. See http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/fef208e7-b79d-4a0c-94fe-e6861196e1f5/#ba47b61c-77a8-46c8-aa10-a04211312e6c for an example. Unfortunately, this won't allow a clickable menu.

XAML fragments and the Visual Studio XAML designer

I'm new to XAML and likely not even thinking about this problem in the right way, but...
Basically I want a little XAML fragment that I can inject into various UserControls under some circumstances. The XAML just shows a small tag at the side of the control using a Border and a TextBlock.
It would be easy enough to cut and paste this to each control, but that feels clumsy and will be a pain any time I want to update it. Sure, I could do this at runtime in the control base class, but I would rather use the designer. I could make the tag a UserControl in its own right, but that sounds needlessly heavyweight too.
So is there some way of making little XAML fragments in the designer that I'm missing? I'm thinking there it would just have (in this case) the Border at the root of the XAML document.
This is for a Windows 8 store app using VS2013.
Have you tried XAML Code Snippets? Tim Heuer has a nice post with examples here:
http://timheuer.com/blog/archive/2013/07/08/xaml-code-snippets-for-visual-studio.aspx

Display graphics inside the Visual Studio editor

I'm trying to augment an existing VS addin with some graphical capabilities. For example, I might want to draw lines between related definitions.
So I'd like to overlay my own WPF control on top of the one used by the editor. How do I get hold of the WPF control used by the editor?
You need to create a new adornment layer for your graphics. See Inside the Editor for more details.

Activereports (under VB6) issue

I have to modify an old VB6 program that uses ActiveReports 2.0 at work and I am having some problems (BTW I have never used this program before and only have a basic knowledge of VB6)...
I have to make some text boxes biggers which is pretty easy to do but as soon as I move them a whole section of text (and not simply the content of that text box) disappear.
I have noticed that it was in some sort of section (sorry, I don't know how they call that) which englobed those text boxes so I made it bigger and that made no difference.
What could be causing this?
Thank you!
Nick
It sounds like the TextBox is inside a UserControl. A UserControl is created by a developer, and is basically one control with any number of other controls in it. You can check to see if there are any User Controls in your project in the Project Explorer (Ctrl+R).
One way to know exactly what class the control belongs to is to open your form in design mode (Shift+F7), click on the control, and look at the Properties window (F4). The drop-down list should show the currently selected control's class name in bold, then the name of the object.
What is the control's class? If it is anything other than TextBox, then this would explain the unexpected behavior you experienced.

How to use the color picker dialog to set color properties in the property editor?

This sounds like a trivial question, but it's proved quite hard to google anything about this.
When editing Color-typed properties through the property editor (when designing WinForms), a little editor pops up with three tabs: Custom, Web and System. I want to set a custom color by using the standard color picker dialog because none of the listed Custom colors are suitable.
I am sure that this used to be possible by double-clicking a blank color on the Custom tab, but this just picks the color being double-clicked and closes the drop-down in my VS2008. Am I imagining this, or did it really use to be possible? Can I do this in VS2008 somehow?
Right click on a blank colour in the palette shown by the custom tab. Brings up the "Define Color" dialog (in VS2008 C# Express, and I imagine the same in other versions).
EDIT - Having discovered this by experimentation, the MSDN library describes it here.
Interestingly, no keyboard-only interface is described.

Resources