DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C# (http://www.daniweb.com/forums/forum61.html)
-   -   Date Picking from windows form Calender (http://www.daniweb.com/forums/thread163114.html)

csharplearner Dec 19th, 2008 4:05 pm
Date Picking from windows form Calender
 
Hi, I am trying to pick the particular chosen date from the windows calender displayed.

I am struck here and confused how to proceed.
Any hints or shedding little light on the progress is appreciated.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace wintest1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            SelectionRange picked = new SelectionRange();
            InitializeComponent();
            textBox1.Text = "Choose date from below";
            if (picked != null)
            {
                textBox1.Text = picked.ToString();
               
            }

        }

        private void calender_DateChanged(object sender, DateRangeEventArgs e)
        {        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {        }
    }
}



Thank you

LizR Dec 19th, 2008 6:38 pm
Re: Date Picking from windows form Calender
 
OK so you found the event to say the selections changed, what exact issue are you having? other than you have put what looks like your date picked code into the form loading event

ddanbe Dec 20th, 2008 9:47 am
Re: Date Picking from windows form Calender
 
DateRangeEventArgs e has a Start and End method, which both return a DateTime object. Do processing in your eventhandlers initialising is done in the constructor.
I would use a DateSelected event if I wanted to know the date selected.


All times are GMT -4. The time now is 4:25 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC