Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8172861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:55:07+00:00 2026-06-06T21:55:07+00:00

I have a WPF WebBrowser control beside a WPF TreeView control. Both have default

  • 0

I have a WPF WebBrowser control beside a WPF TreeView control. Both have default styles with default properties. I have not changed anything except placing them on my WPF window. If you view the screen shot below you can see the two controls have two different scroll bars. I have no idea why this is happening.

Is there a way to make one control’s scroll bar look like the other, or just default them both to windows styles?

Thanks

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T21:55:09+00:00Added an answer on June 6, 2026 at 9:55 pm

    To answer your comment:

    Is there a way to keep that theme in my resources (my ribbon control uses it) and just remove the scroll bar theme from that tree view control? – Landin Martens Jun 23 at 19:49

    Yes.

    Option 1

    You can override the default style for a control like so:

    <Style TargetType="{x:Type TreeView}">
      ...
    </Style>
    

    This will change the styling for every TreeView control (assuming the style is defined in your App.xaml dictionary). If you only want to override the style for a few controls, you can name it:

    <Style x:Key="XTreeViewStyle"
           TargetType="{x:Type TreeView}">
      ...
    </Style>
    

    And the set the style explicitly for those controls (<TreeView Style="{StaticResource XTreeViewStyle}"/>). Or, you can create the style within a specific context, such as a Grid (thus affecting only those controls within the Grid):

    <Grid>
      <Grid.Resources>
        <Style TargetType="{x:Type TreeView}">
        </Style>
      </Grid.Resources>
    </Grid>
    

    It is my guess that the style which is overriding your scrollbars is not targeting TreeViews specifically… it is probably targeting a control that TreeView inherits from. So, look for a default style which targets TreeView, ItemsControl, Control, FrameworkElement or UIElement. When you find it, you can either give it a name, or move the style into a more limited context.

    For example, your styles are probably set up something like this:

    <Style TargetType="{x:Type ItemsControl}">
      ...
    </Style>
    
    <Style TargetType="{x:Type Ribbon}">
      <Style.Template>
        <ControlTemplate>
          <ItemsControl>
            ...
          </ItemsControl>
        </ControlTemplate>
      </Style.Template>
    </Style>
    

    To have the ItemsControl style only affect the Ribbon, you could move the ItemsControl style into the Ribbon’s template:

    <Style TargetType="{x:Type Ribbon}">
      <Style.Template>
        <ControlTemplate>
          <ControlTemplate.Resources>
            <Style TargetType="{x:Type ItemsControl}">
              ...
            </Style>
          </ControlTemplate.Resources>
          <ItemsControl>
            ...
          </ItemsControl>
        </ControlTemplate>
      </Style.Template>
    </Style>
    

    The exact approach, however, is going to depend on how exactly your styles are setup, and this may be much more complicated then I have suggested. For example, if you have several different styles which all need to use that ItemsControl style, you might use naming and inheritance like this:

    <Style TargetType="{x:Type ItemsControl}"
           x:Key="XItemsControlStyle">
      ...
    </Style>
    
    <Style TargetType="{x:Type Ribbon}">
      <Style.Template>
        <ControlTemplate>
          <ControlTemplate.Resources>
            <Style TargetType="{x:Type ItemsControl}"
                   BasedOn="{StaticResource XItemsControlStyle}">
              ...
            </Style>
          </ControlTemplate.Resources>
          <ItemsControl>
            ...
          </ItemsControl>
        </ControlTemplate>
      </Style.Template>
    </Style>
    
    <Style TargetType="{x:Type RibbonItem}">
      <Style.Template>
        <ControlTemplate>
          <ControlTemplate.Resources>
            <Style TargetType="{x:Type ItemsControl}"
                   BasedOn="{StaticResource XItemsControlStyle}">
              ...
            </Style>
          </ControlTemplate.Resources>
          <ItemsControl>
            ...
          </ItemsControl>
        </ControlTemplate>
      </Style.Template>
    </Style>
    

    Option 2

    Set the style for the TreeView explicitly. This will mean finidng the original style for the TreeView (or at least the one you want to use), giving it a name and then setting explicitly on the TreeView you want to style. (See Option 2 for how to do that)

    I believe that these links will provide you with default styles:

    • TreeView
    • ScrollBar
    • ScrollViewer
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have found that WebBrowser control (both Winforms and WPF) has certain javascript constructs
I have a web page that I display in a WPF WebBrowser control within
I have a full screen WPF application where i host a WebBrowser. Both are
I have a C# WPF application with a web browser control (System.Windows.Controls.WebBrowser) called wB.
I have a simple WPF webBrowser control that I am using to automate a
I have a simple WPF application with a webbrowser control. When I direct the
Inside of my WPF application, I have embedded a WebBrowser control, which in turn
I have a WPF System.Windows.Controls.WebBrowser control in a Window. A user can enter information
I have a WPF where I am implementing a WebBrowser control and I have
Consider a scenario where I have a WebBrowser Control in WPF application. A web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.