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 am studying the Windows programming by using the book Programming.Windows.5th.Edition(Charles Petzold). When I
We followed the instructions in the following page. http://www.charlesproxy.com/documentation/faqs/using-charles-from-an-iphone/ But it doesn't seem to
I am reading Charles Petzold's Programming windows. 5th Edition. And there is a statement
I am reading Programming.Windows.5th.Edition,Charles Petzold when I was doing the Figure 4-5. SYSMETS1.C,I met
I need a taper-effect on my transform in WPF. Charles Petzold wrote some nice
I'm using Charles Proxy for http debugging. For switching http method GET to POST,
I am learning about the Intel 8080 processor in Charles Petzold's excellent book Code
I'm using Charles Campbell's MPage[0] plugin to get multiple pages open, so I have
In Charles Petzold's book Programming Windows, he mentioned the following: Be careful with GetKeyState.
I am currently reading Charles Petzold's book 'Code'. In it he explains how to

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.