0

I have made a toolbar that has a Search Textbox, using the visual studio built in search for the toolwindowpane: https://learn.microsoft.com/pt-pt/previous-versions/visualstudio/visual-studio-2015/extensibility/adding-search-to-a-tool-window?view=vs-2015&redirectedfrom=MSDN

That is working just fine right now after overriding the methods, however i also added a toolbar to the toolwindow from the vsct file, however it is positioning the search and the toolbar in the same row:

enter image description here

Is there any way to position the search bar underneath the toolbar just like the solution explorer in visual studio? If not, is there a way to decrease the toolbar size so it uses the minimum space so it doesn't look weird like in the picture?

Thank you.

EDIT: Constructor of the class that inherits ToolWindowPane:

public CpcObjectsWindow() : base(null)
    {
        this.Caption = "CPC Objects";

        // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
        // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
        // the object returned by the Content property.
        this.Content = new CpcObjectsWindowControl();

        this.ToolBar = new CommandID(new Guid(CpcExtensionPackage.guidCpcExtensionPackageCmdSet), CpcExtensionPackage.cpcObjectsToolbar);
        this.ToolBarLocation = (int)VSTWT_LOCATION.VSTWT_TOP;
    }
  • Can you provide the code about the toolbar location? You can also see this link about [ToolBarLocation](https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.toolwindowpane.toolbarlocation?view=visualstudiosdk-2022#microsoft-visualstudio-shell-toolwindowpane-toolbarlocation) Property, it can set the location of toolbar. – Jingmiao Xu-MSFT Nov 30 '22 at 03:53
  • @JingmiaoXu-MSFT the toolbar location is currently set to VSTWT_TOP. I added the constructor code of the ToolWindowPane in the question. I want it at top, but the search bar i wanted it to be under that. I tried using the SearchSettings to set the minwidth and maxwidth of the search control, however even trying to mess with that i can't guarantee that the search control will be under the toolbar when the window is resized. – Vasco Ferreira Nov 30 '22 at 09:45

1 Answers1

0

I tried to add search to a tool window , a search control appears at the top of the tool window.

enter image description here

I tried to search form the ToolWindowPane Class but there is not any property can set the size of search bar. I think that you can submit a feature request on DC.

Jingmiao Xu-MSFT
  • 2,076
  • 1
  • 3
  • 10
  • I report this issue on DC, you can follow [this link](https://developercommunity.visualstudio.com/t/Place-Search-Textbox-below-the-toolbar-i/10218828?port=1025&fsid=abd1b03a-d20d-4f1f-924c-a999b59f14fe). – Jingmiao Xu-MSFT Dec 01 '22 at 08:55