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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:03:07+00:00 2026-05-23T23:03:07+00:00

I am creating a messages ticker for my application. <UserControl.Resources> <DataTemplate x:Key=MessagesDataTemplate> <TextBlock FontWeight=Bold

  • 0

I am creating a messages ticker for my application.

 <UserControl.Resources>
    <DataTemplate x:Key="MessagesDataTemplate">
        <TextBlock 
           FontWeight="Bold" 
           FontSize="12" 
           Text="{Binding Path=Message}" 
           Height="30" 
           Margin="2"/>
    </DataTemplate>
</UserControl.Resources>

<Grid>
    <ItemsControl 
       ItemsSource="{Binding Messages}" 
       ItemTemplate="{StaticResource MessagesDataTemplate}">          
    </ItemsControl>
</Grid>

I want to display a Message item (i.e. the TextBlock) for 5 seconds then move to the next item (vertically).

Can anyone guide me on this please?

  • 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-23T23:03:08+00:00Added an answer on May 23, 2026 at 11:03 pm

    I have created a sample
    here is xaml and code behind for that

    <UserControl x:Class="WpfApplication1.MessageTicker"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                 mc:Ignorable="d" Height="30">
         <UserControl.Resources>
        <DataTemplate x:Key="MessagesDataTemplate">
            <Grid x:Name="grid" RenderTransformOrigin="0.5,0.5">
                <Grid.Resources>
                    <Storyboard x:Key="sb2">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" >
                            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="2"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" >
                            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="2"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" >
                            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="2"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="2"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </Grid.Resources>
                <Grid.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Grid.RenderTransform>
                <Grid.Style>
                    <Style>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}},Path=IsSelected}" Value="True">
                                <DataTrigger.EnterActions>
                                    <BeginStoryboard Storyboard="{StaticResource sb2}"> 
    
                                    </BeginStoryboard>
                                </DataTrigger.EnterActions>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Grid.Style>
                <TextBlock 
           FontWeight="Bold" 
           FontSize="12" 
           Text="{Binding Path=Message}" 
           Height="30" 
           Margin="2"/>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid>
        <ListBox BorderThickness="0" BorderBrush="Transparent" Name="messagesLB"
       ItemsSource="{Binding Messages}" 
       ItemTemplate="{StaticResource MessagesDataTemplate}">
        </ListBox>
    </Grid>
    </UserControl>
    

    Code Behind

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using System.Windows.Threading;
    
    namespace WpfApplication1
    {
        /// <summary>
        /// Interaction logic for MessageTicker.xaml
        /// </summary>
        public partial class MessageTicker : UserControl
        {
            public MessageTicker()
            {
                InitializeComponent();
                List<Temp> Messages = new List<Temp>();
                for (int i = 0; i < 10; i++)
                {
                    Messages.Add(new Temp { Message = "Message" + i });
                }
                messagesLB.ItemsSource = Messages;
                DispatcherTimer dt = new DispatcherTimer();
                dt.Tick += new EventHandler(dt_Tick);
                dt.Interval = TimeSpan.FromSeconds(2);
                dt.Start();
            }
    
            void dt_Tick(object sender, EventArgs e)
            {
                if ((messagesLB.SelectedIndex + 1) < messagesLB.Items.Count)
                    messagesLB.SelectedIndex = messagesLB.SelectedIndex + 1;
                else
                    messagesLB.SelectedIndex = 0;
                messagesLB.ScrollIntoView(messagesLB.SelectedItem);
            }
    
            public class Temp
            {
                public string Message { get; set; }
            }
        }
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a console application that should receive messages from the network in order
Let's say you're creating a database to store messages for a chat room application.
I'm creating a GUI application that can monitor and manipulate a stream of messages.
I am creating an RCP application, with many Greek messages, so everything is in
I am creating a web application that is going to send messages using NServiceBus,
I am creating an application which displays some messages and its directions in the
I'm creating a logger application thing to learn WPF, and I want new messages
As school project I'm creating a FileSharing application. I send all the messages I
how can I show users success/error messages without creating a node for it? Thanks
When creating iPhone apps in simulator, I sometimes see messages like Springboard failed 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.