Skip to content

Adding Button on Visual Studio Title Bar #499

Closed Answered by reduckted
workgroupengineering asked this question in Q&A
Discussion options

You must be logged in to vote

It's only possibly by hacking the UI. I wouldn't recommend it... but, in the interests of experimentation, here's what I've managed to do. 🧪

You can use Snoop to inspect the WPF visual tree of the Visual Studio main window and see where you might be able to put your UI elements.

This code will add an icon next to the user avatar.

Warning

This is probably a bad idea!

private void EditTitleBar() {
    foreach (DependencyObject item in GetDescendants(Application.Current.MainWindow)) {
        if (item is FrameworkElement element) {
            if (element.Name == "PART_TitleBarRightFrameControlContainer") {
                DependencyObject parent = VisualTreeHelper.GetParent(element);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by workgroupengineering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants