When i double click on an special date in the calender the current date which has been chosen automatically added to a list box
How can i do that ?Please Guide me.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Joe WilsonPosted Jun 17, 2014, 10:48 PM
VulpesPosted Jun 15, 2014, 11:01 AM
Much better idea :)
Joe WilsonPosted Jun 15, 2014, 6:45 AM
Joe WilsonPosted Jun 15, 2014, 6:43 AM
What do you think about this way?
VulpesPosted Jun 14, 2014, 3:58 PM
Joe WilsonPosted Jun 14, 2014, 6:26 AM
VulpesPosted May 27, 2014, 9:06 AM
At least, that's what it did when I tested it :)
Incidentally, it might be best to set the MonthCalendar's MaxSelectionCount property to 1 to ensure that there's no confusion with other dates that may be selected at the same time.
Joe WilsonPosted May 27, 2014, 3:28 AM
VulpesPosted May 26, 2014, 6:59 AM
However, you can manufacture you're own using the MouseDown event by calculating the time between events and seeing if it's short enough to be regarded as a double click:
Note that double clicking on the month or a year also causes a selection to be made.
Joe WilsonPosted May 25, 2014, 2:16 PM
Joe WilsonPosted May 25, 2014, 7:35 AM
Joe WilsonPosted May 24, 2014, 1:58 PM
although i want to add every date which i want for example my birth date to the list box.
Thank you
Ranjit PowarPosted May 24, 2014, 10:24 AM
private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
listBox1.Items.Add(monthCalendar1.SelectionEnd.ToString());
}
Ranjit PowarPosted May 24, 2014, 7:33 AM
Joe WilsonPosted May 24, 2014, 7:27 AM
Please Check it.
Ranjit PowarPosted May 24, 2014, 3:18 AM
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
listBox1.Items.Add(dateTimePicker1.Value .ToString());
}
Joe WilsonPosted May 24, 2014, 2:55 AM
Joe WilsonPosted May 24, 2014, 2:41 AM
Jose SaizPosted May 23, 2014, 7:04 PM
listbox.items.add(calendar.date.picked)
Quick and dirty
Instantiate the listbox control
ListBox lslBox = new ListBox();
// Add the system date mm/dd/yyyy
lslBox.Items.Add(DateTime.Now.ToShortDateString());