Click here to Skip to main content
11,639,593 members (64,686 online)
Click here to Skip to main content

Seven Segment in WPF

, 24 Jan 2012 CPOL 17.4K 2.2K 31
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

You may also be interested in...

Comments and Discussions

 
QuestionImproper "two dots" synchronization Pin
Philippe Mori3-Nov-14 17:10
memberPhilippe Mori3-Nov-14 17:10 
GeneralMy vote of 2 Pin
ridoy21-Sep-13 6:56
professionalridoy21-Sep-13 6:56 
QuestionGood but how to scale Pin
Jason Song1-Jun-12 4:27
memberJason Song1-Jun-12 4:27 
AnswerRe: Good but how to scale Pin
Mohammad Dayyan3-Jun-12 21:35
memberMohammad Dayyan3-Jun-12 21:35 
QuestionExcellent Pin
jcarter12121225-May-12 15:03
memberjcarter12121225-May-12 15:03 
GeneralMy vote of 2 Pin
DavidMyEmail25-Jan-12 4:55
memberDavidMyEmail25-Jan-12 4:55 
QuestionNeeds more depth Pin
CIDev25-Jan-12 2:26
memberCIDev25-Jan-12 2:26 
GeneralKeep up the creative work Pin
TonyVictorious25-Jan-12 1:39
memberTonyVictorious25-Jan-12 1:39 
GeneralRe: Keep up the creative work Pin
Mohammad Dayyan25-Jan-12 1:42
memberMohammad Dayyan25-Jan-12 1:42 
QuestionThis is not really an article Pin
Sacha Barber24-Jan-12 19:59
mvpSacha Barber24-Jan-12 19:59 
QuestionGood but of no use. Pin
aamironline24-Jan-12 19:13
memberaamironline24-Jan-12 19:13 
AnswerRe: Good but of no use. Pin
Andy Missico24-Jan-12 20:09
memberAndy 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 | Terms of Use | Mobile
Web03 | 2.8.150731.1 | Last Updated 25 Jan 2012
Article Copyright 2012 by Mohammad Dayyan
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid