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

  • SEARCH
  • Home
  • 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 113425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:42:01+00:00 2026-05-11T02:42:01+00:00

In Charles Petzold’s Using Templates to Customize WPF Controls article in the Jan 2007

  • 0

In Charles Petzold’s ‘Using Templates to Customize WPF Controls’ article in the Jan 2007 edition of MSDN Magazine (http://msdn.microsoft.com/en-us/magazine/cc163497.aspx), he says,

The ProgressBar control actually has two default templates for the two orientations. (This is true of ScrollBar and Slider, as well.) If you want your new ProgressBar to support both orientations, you should write two separate templates and select them in the Triggers section of a Style element that you also define for the ProgressBar.

I am currently writing a custom control that requires this functionality, but can’t work out how to do as he says – not in any way that works, anyhow. Does anybody have a sample of this?

Thanks in advance.

  • 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. 2026-05-11T02:42:02+00:00Added an answer on May 11, 2026 at 2:42 am

    You can see how its done in the scrollbar sample control template http://msdn.microsoft.com/en-us/library/ms742173.aspx

    I copied only the relevant parts of the sample here.

    In short there are two templates in the resource dictionary:

    <ControlTemplate x:Key='VerticalScrollBar' TargetType='{x:Type ScrollBar}'> ...  <ControlTemplate x:Key='HorizontalScrollBar' TargetType='{x:Type ScrollBar}'> ... 

    And a trigger in the style to switch between them :

    <Style x:Key='{x:Type ScrollBar}' TargetType='{x:Type ScrollBar}'>   <Style.Triggers>     <Trigger Property='Orientation' Value='Horizontal'>       <Setter Property='Template' Value='{StaticResource HorizontalScrollBar}' />     </Trigger>     <Trigger Property='Orientation' Value='Vertical'>       <Setter Property='Template' Value='{StaticResource VerticalScrollBar}' />     </Trigger>   </Style.Triggers> </Style> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a taper-effect on my transform in WPF. Charles Petzold wrote some nice
As a big fan of Charles Petzold's books Code and The Annotated Turing I
Based on information in Chapter 7 of 3D Programming For Windows (Charles Petzold) ,
I am currently reading Charles Petzold's book 'Code'. In it he explains how to
Years ago, in my long lost copy of Charles Petzold's Windows 3.0 Programming book,
I read this article, the parts of Intellisense and Generated Code: http://www.charlespetzold.com/etc/DoesVisualStudioRotTheMind.html Do you
I'm using Charles Proxy's handy Map Local tool to develop CSS documents. This way
I'm using Charles Proxy to redirect web requests to a local folder for an
I've seen a few programs (eg Charles Web Developer Proxy) that are able to
This was something originally discussed during a presentation given by Charles Brian Quinn of

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.