Date Picking from windows form Calender

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 99
Reputation: csharplearner is an unknown quantity at this point 
Solved Threads: 3
csharplearner's Avatar
csharplearner csharplearner is offline Offline
Junior Poster in Training

Date Picking from windows form Calender

 
0
  #1
Dec 19th, 2008
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.

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace wintest1
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. SelectionRange picked = new SelectionRange();
  17. InitializeComponent();
  18. textBox1.Text = "Choose date from below";
  19. if (picked != null)
  20. {
  21. textBox1.Text = picked.ToString();
  22.  
  23. }
  24.  
  25. }
  26.  
  27. private void calender_DateChanged(object sender, DateRangeEventArgs e)
  28. { }
  29.  
  30. private void textBox1_TextChanged(object sender, EventArgs e)
  31. { }
  32. }
  33. }



Thank you
Last edited by csharplearner; Dec 19th, 2008 at 4:10 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: Date Picking from windows form Calender

 
0
  #2
Dec 19th, 2008
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
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,917
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 274
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso

Re: Date Picking from windows form Calender

 
0
  #3
Dec 20th, 2008
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.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC