473,322 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Get the date form the monthCalander control

how can get the date selected in the monthCalander Control

i'm able to see the selectionstart property but its displaying the
date and the start time (i.e) 12:00:00 AM
i used the following code to get the date selected in the
monthCalander control

DateTime date = new DateTime();
date = Convert.ToDateTime(monthCalendar1.SelectionStart);

label2.Text = date.Date.ToString();

but it didn't work... what to do. I want the date selected in the
monthCalander control to be displayed in
label1.text.

-- Sravan Reddy

Jun 26 '07 #1
1 2412
Hi,

How exactly it didn't work?
As you can select range of dates use SelectionRange property to properly
get user selecting dates or direct properties:

monthCalendar1.SelectionStart.ToShortDateString()
monthCalendar1.SelectionEnd.ToShortDateString()
(it should provide you selected dates (without time))

If only one value is selected they are equal.

Kind Regards, Alex Meleta
[TechBlog] http://devkids.blogspot.com

show can get the date selected in the monthCalander Control
s>
si'm able to see the selectionstart property but its displaying the
sdate and the start time (i.e) 12:00:00 AM
si used the following code to get the date selected in the
smonthCalander control
sDateTime date = new DateTime();
sdate = Convert.ToDateTime(monthCalendar1.SelectionStart);
slabel2.Text = date.Date.ToString();
s>
sbut it didn't work... what to do. I want the date selected in the
smonthCalander control to be displayed in
slabel1.text.
Jun 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Larry R Harrison Jr | last post by:
I use the Lebans calendar control and love it; the only thing is that it commonly starts out at the year 1899 rather than the current year. Is there a way to specifically tell it to start at the...
7
by: Tony Williams | last post by:
I have a check box called Loadtxt and when it is ticked I want the value of a control called EmailDatetxt to be today's date. I am using this code in the AfterUpdate event of the checkbox but it...
0
by: Andreas Belitz | last post by:
Hello, in my project, i use a form with Microsoft's Dte Picker Control (MSComCtl2.DTPicker.2). This control is linked up to a date field of a table. When i open the form, the control always...
1
by: billy | last post by:
Ok, here's the situation... I have a user control that contains two textboxes (one for a from date/time and one for a to date/time) and two image buttons. The user control itself is supposed to...
0
by: TB | last post by:
Hi All: A kind soul provided by with the code for very nice calendar popup, which all in all works fine execpt for one thing: If I pick the current date (i.e. today's date) then the pop-up does...
9
by: insomniux | last post by:
Hi, I am having a problem with formatting the default value of a date field. It has been discussed earlier in many topics, but still I cannot solve the problem. What's happening: I have various...
10
by: sandraz444 | last post by:
I have an expression in the query under my form to autofill the date under a certain condition but it wont write to the underlying table?? The date shows in the form but not the table. Does anyone...
5
by: M Skabialka | last post by:
I am creating my first Visual Studio project, an inventory database. I have created a form and used written directions to add data from a table to the form using table adapters, data sets, etc. ...
0
by: fredloh | last post by:
i have a tab control on my form. i then have several microsoft date and time picker control on the tab control. when i select a date on any of the date and time picker control, the result of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.