Click here to Skip to main content
Click here to Skip to main content
Go to top

Seven Segment in WPF

, 24 Jan 2012
Rate this:
Please Sign up or sign in to vote.
WPF Seven Segment User Control

WPF Seven Segment

Introduction

In some of graphical softwares we need to have something like a SevenSegment, I need it somedays ago. So I've created this UserControl.

Background

I saw some seven segment user controls in different websites.
e.g:
Seven-segment LED Control for .NET
http://www.teroid.net/product.aspx?name=wpfsevensegmentdisplay
but no one of them could resolve my need.

Using the code

If you like to use this usercontrol in your application , you have to follow the following instructions :

1. First, you have to add the usercontrol Dll into your Application References :

References

2. Next, Add the following property into the Window tag :

Add the property into the Window tag

3. At Last, You can use the UserControl with the following XAML code :

You can use the UserControl with this code

Public Properties of SevenSegment UserControl

/// <summary>
/// Color Of Seven Segment Number
/// </summary>
public SolidColorBrush NumberColor
{
    ...
}

/// <summary>
/// Color Of dot `.` char
/// </summary>
public SolidColorBrush ColonColor
{
    ...
}

/// <summary>
/// Is `.` Visible or not
/// </summary>
public Visibility DotVisibility
{
    ...
}

/// <summary>
/// Is `:` Visible or not
/// </summary>
public Visibility ColonVisibility
{
    ...
}

/// <summary>
/// Delay of number blinking animation
/// </summary>
public KeyTime KeyTime { get; set; }

/// <summary>
/// Delay of `.` char blinking animation
/// </summary>
public KeyTime ColonKeyTime { get; set; }

/// <summary>
/// Peresents colon characters `:` with animation
/// </summary>
public bool ColonAnimation
{
    ...
}

/// <summary>
/// Radius of Blur on SevenSegment 
/// </summary>
public int BlurRadius
{
    ...
}

/// <summary>
/// Peresents SevenSegment with animation
/// </summary>
public bool PlayAnimation
{
    ...
}

Public Method of SevenSegment UserControl

/// <summary>
/// Sets number of seven segment number
/// </summary>
public void SetNumber(int number) { ... }

History

First Post : 2012/01/26

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Mohammad Dayyan

Iran (Islamic Republic Of) Iran (Islamic Republic Of)
No Biography provided

Comments and Discussions

 
GeneralMy vote of 2 Pinprofessionalridoy21-Sep-13 6:56 
QuestionGood but how to scale PinmemberJason Song1-Jun-12 4:27 
AnswerRe: Good but how to scale PinmemberMohammad Dayyan3-Jun-12 21:35 
QuestionExcellent Pinmemberjcarter12121225-May-12 15:03 
GeneralMy vote of 2 PinmemberDavidMyEmail25-Jan-12 4:55 
QuestionNeeds more depth PinmemberCIDev25-Jan-12 2:26 
GeneralKeep up the creative work PinmemberTonyVictorious25-Jan-12 1:39 
GeneralRe: Keep up the creative work PinmemberMohammad Dayyan25-Jan-12 1:42 
QuestionThis is not really an article PinmvpSacha Barber24-Jan-12 19:59 
QuestionGood but of no use. Pinmemberaamironline24-Jan-12 19:13 
AnswerRe: Good but of no use. PinmemberAndy Missico24-Jan-12 20:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140921.1 | Last Updated 25 Jan 2012
Article Copyright 2012 by Mohammad Dayyan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid