How to access and add/modify controls in MainWindowTitleBar - visual-studio-2019

I'm writing extension for Visual Studio 2019 and I want do add or modify some controls that are in MainWindowTitleBar (compact menu option is enabled). How can I do that? Is there a service for that?
All sources about extensions focus on adding new toolboxes or menu items or use specialized services/interfaces to do certain thing but none of them talk about modifying existing interface.

You can use System.Windows.Media.VisualTreeHelper to find desired Visual Studio controls and then manipulate them as regular WPF controls.

Related

visual studio extension tool window opens every time visual studio opens up

I added a tool window to VSIX extension using these steps https://learn.microsoft.com/en-us/visualstudio/extensibility/creating-an-extension-with-a-tool-window?view=vs-2019
When the extension is installed the tool window must open once
But the tool window opens up every time the Visual studio opens.
How to open tool window only when it is required?
These are the attributes am using,
[ProvideToolWindow(typeof(MyWindow), Orientation = ToolWindowOrientation.Left, DocumentLikeTool = true, Style = Microsoft.VisualStudio.Shell.VsDockStyle.Tabbed)]
[ProvideToolWindowVisibility(typeof(MyWindow), VSConstants.UICONTEXT.SolutionExists_string, Name = "Extension Overview")]
Deepak,
By using VSConstants.UIContext.SolutionExists_string, you are registering the toolwindow to display whenever a solution exists in the VS IDE. If you don't want this behavior, remove the attribute.
Note, Toolwindows are almost always associated with a particular scenario or IDE state (like during debugging, building, or coding). This is typically where you would leverage the ProvideToolWindowVisibility attribute. To associate your toolwindow to a specific activity or state. However, if the user manually closes the toolwindow while in that UI state, the IDE will try to remember that. So that it no longer appear by default while (debugging, building, or coding, etc.). This is what is meant, when the toolwindow layout is described as being "sticky".
If you are curious as to what UI Contexts are currently active in the IDE (to figure out which you'd like your toolwindow to be visible with), I highly recommend using the Component Diagnostics extension, to monitor what UI Contexts are active, during the scenario(s) you want your toolwindow to show up under.

unable to find few visio objects on visual studio 2019

I am trying to write a visio application. If I write in Macro (within visio app), I get all objects. However, when I try to write same code in Visual Studio 2019, I cant find references. Like ActiveWindow or visSectionAction. I am trying to follow this: Add Menu Action Programatically to Visio
What references am I missing. I added nuget package, added office object library.
TIA
To use Visio object model from a .NET application, you need to add a reference to Visio type library to that application. This is Microsoft.Office.Interop.Visio. You could start over in the Microsoft documentation: https://learn.microsoft.com/en-us/visualstudio/vsto/visio-object-model-overview
The global VBA objects, like ActiveWindow, are available as app.ActiveWindow (assuming the "app" is the root Visio Application object you access). In case of an Add-In:
var w = Globals.ThisAddIn.Application.ActiveWindow
or in case you need to access from a method of the add-in:
var w = Application.ActiveWindow
Enumerations should be prefixed with its type: VisSectionIndices.visSectionAction.
Please note that the answer in the linked question explains how to add a menu item to a shape, not to the application. If you want to extend application menu rather than shape menu (?), you need to add your menu item to the ribbon definition.

Visual Studio 2013 Document Outline tool always empty

I'm currently editing a large CSS-file in the Visual Studio 2013 editor, and would hugely benefit from a tool that hierarchically listed the content of the files I'm editing. From what I understand, the Document Outline (DO) tool in VS is supposed to achieve this, however, it never actually displays anything; regardless of the document I am editing while the DO panel is visible (CSS, C#, JS, XML etc..), it just tells that:
There are no items to show for the selected document.
First of all, is the DO the right tool for the job, and if yes, how do I get it to display my pages' content? Am I perhaps missing some dll-files?
For the reference, I am developing an asp.net-MVC application.
You may want to install the Mexedge Stylesheet Extension that displays CSS structure in Solution Explorer.

Identifying Views in the Visual Studio Tab List

In MVC you are likely to have many views with the same name (such as Index.cshtml or Edit.aspx) for the various controllers.
Depending on your working style, you might end up with a few tabs open in Visual Studio ending up with a tablist that looks like:
Index.cshtml|Index.cshtml|SomeController.cs|Edit.cshtml|Index.cshtml|Edit.cshtml|
It is possible to hover over the tabs and wait for the context hint to show up, but I was wondering if anyone had a technique or plugin where the correct file could be more easily identified at a glance (i.e. the Index.cshtml for the SomeController)?
There may be an extension in the Visual Studio 2010 Pro Power Tools that will make your life easier. The Document Well 2010 Plus allows you to configure the document tabs.
I think http://www.tabsstudio.com/ may have the behavior you are looking for.
When you install it you should open the 'Tabs Studio Add-in Manager' and check 'Disambiguator'.
When you have different files open with the same name, it will display it's containing folder.
Home/Index.html | About/Index.html

Organize windows in a SDI Delphi Application

In an Delphi MDI application i can use the Tile,Cascade and ArrangeIcons procedures to organize my child windows, this methods only works when the FormStyle property is set to fsMDIForm, How i can produce the same effect in an SDI application, i mean how i can organize my open windows in a non MDI application?
Usually, you don't have to. Users who wish to re-arrange the windows can right-click the taskbar and choose the tile and cascade commands from the context menu. And I've seen TV commercials for Windows 7 showing that you can even just drag windows in a certain way to make them arrange themselves.
If you still want to provide the command yourself, use the TileWindows and CascadeWindows API functions.
You would have to organize them manually by looping through the TScreen::Forms[] list adjusting the Left/Top properties as needed.

Resources