Click here to Skip to main content
15,892,697 members
Articles / Desktop Programming / Windows Forms

Farsi Library - Working with Dates, Calendars, and DatePickers

Rate me:
Please Sign up or sign in to vote.
4.93/5 (236 votes)
21 Nov 2007MIT8 min read 2.9M   95.2K   202  
A library to work with "Persian Calendar", "Hijri Calendar", and "Gregorian Calendar" with WinForms GUI controls designed for Persian (Farsi) or Arabic language applications in mind, but usable in any Windows application that makes use of calendars and dates.
using System;
using FarsiLibrary.Utils;

namespace FarsiLibrary.Test
{
    public partial class frm07 : baseForm
    {
        #region Ctor

        public frm07()
        {
            InitializeComponent();
        }

        #endregion

        #region EventHandlers

        private void btnConvert_Click(object sender, EventArgs e)
        {
            try
            {
                long num = long.Parse(txtNumber.Text);
                lblResult.Text = ToWords.ToString(num);
            }
            catch(ArgumentOutOfRangeException)
            {
                lblResult.Text = "لطفا عدد کوچکتری را وارد کنید";
            }
            catch(FormatException)
            {
                lblResult.Text = string.Empty;
            }
        }

        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Software Developer (Senior) Readify
Australia Australia
Working on both Java and .NET Technology, I have developed various enterprise level applications on both platforms. Currently, I am working as a Senior Software Developer at Readify which is a leading company on .NET technology in Australia.

Comments and Discussions