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 447387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:33:55+00:00 2026-05-12T21:33:55+00:00

I have a slider and a label control. The text is displayed in the

  • 0

I have a slider and a label control. The text is displayed in the label (few paragraphs).

  1. I need to show only 3 words at a time.Every 1 second, move to the next set of 3 words.
  2. The slider is used to select the number of words that can be seen at once. So a user can increase it to say 10 and now every 1 second, a set of 10 words need to be displayed.

How would I achieve this behavior in WPF? I know I need to do some kind of databinding between the slider and a label, but not sure how to get the effect of (1) or (2).

Any help is appreciated!

  • 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-05-12T21:33:56+00:00Added an answer on May 12, 2026 at 9:33 pm

    Here is how I would solve it without using my {edf:ExpressionBinding} feature (which, alas, is not yet publically available):

    Step 1: Create three DependencyProperties (not traditional NET properties) in your class:

     Text
     WordsPerGroup
     GroupToShow
    

    Step 2: Bind the Slider to the “WordsPerGroup” property:

     <Slider ... Value="{Binding WordsPerGroups}" />
    

    Step 3: Create an animation using a LinearInt32KeyFrame to animate the “GroupToShow” property that counts once per second and lasts as long as you like, for example this lasts 1 hour and counts to 3600:

     <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="GroupToShow" ...>
       <LinearInt32KeyFrame KeyTime="01:00:00" Value="3600" />
     <Int32AnimationUsingKeyFrames>
    

    Step 4: Create a Converter that takes “Text”, “GroupToShow” and “WordsPerGroup” and returns the text to display:

    public SelectWordsConverter : IMultiValueConverter
    {
      public object ConvertTo(object [] values, ...)
      {
        string text = values[0] as string;
        int groupToShow = values[1] as int;
        int wordsPerGroup = values[2] as int;  // maybe double, depending on slider binding
    
        return
          string.Join(" ",
            text
             .Split(" ", StringSplitOptions.RemoveEmptyEntries)
             .Skip(groupToShow * wordsPerGroup)
             .Take(wordsPerGroup)
          );
       }
       ...
    

    Step 5: Use a MultiBinding to bind the TextBlock’s Text property using your converter:

    <TextBlock ...>
      <TextBlock.Text>
        <MultiBinding Converter="{x:Static local:SelectWordsConverter.Instance}">
          <Binding Path="Text" />
          <Binding Path="GroupToShow" />
          <Binding Path="WordsPerGroup" />
        </MultiBinding>
      </TextBlock.Text>
    </TextBlock>
    

    Step 6: Make sure you start your animation on load, or whenever you want the animation to start moving.

    Step 7: (optional) Add a PropertyChangedCallback to “GroupToShow” to detect when the words have all been shown and do something appropriate (like start over, or stop the animation).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a slider for displaying real time in slider-label from 12-00 AM to
I have Slider in my app that is connected to a few methods. In
I am using jquery Mobile 1.0. I have this html code. <label for=slider class=ui-hidden-accessible>
I have an audio player and I want to show the current time of
I have an NSSlider (slider) and an NSLabel (label) on a window. I also
I currently have a slider control that looks like this: <cc1:SliderExtender ID=sliderTest runat=server Enabled=True
i have a view with one slider and a label.i am showing a countdown
i have IBOutlet uislider. i want it to show the value of slider when
Next to a label showing the value of a slider i want to show
I have a slider with a maximum value of 9. Every Value shall change

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.