473,414 Members | 1,937 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,414 software developers and data experts.

DateTimePicker Value...

233 100+
I am using a DateTimePicker in a Windows Form app., but the value is always the current date. I am displaying the value of the picker in a label when a button is clicked, but the value does not change even though the picker shows the newly selected date. What am I missing here?

Expand|Select|Wrap|Line Numbers
  1. lblTest.Text = dtPicker.Value.ToString();
Apr 16 '09 #1
5 2990
Bassem
344 100+
When do you set the lblTest.Text, post the full code because there is no problem in what you posted.
Apr 16 '09 #2
mcfly1204
233 100+
Expand|Select|Wrap|Line Numbers
  1.  private void button1_Click(object sender, EventArgs e)
  2.         {
  3.             label1.Text = dtpFollowup.Value.ToString(); ;
  4.         }
Apr 16 '09 #3
Plater
7,872 Expert 4TB
Are you sure you don't accidently have one dtp on top of the other?
I have no problems using a DateTimePicker's value
Apr 16 '09 #4
Bassem
344 100+
I'm sure that there is another piece of code that change dtpFollowup.Value or if you've more than one DateTimePicker it maybe not the one you test.
Apr 16 '09 #5
mcfly1204
233 100+
@Plater
Go figure. I assumed it had to be something such as this given it is not a complex process.
Apr 16 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Ed Crowley | last post by:
I have a DateTimePicker control on my form that is displaying the date format in UK format (dd/mm/yy). However, in my code dtpStartDate.Value gives a date in US format, but...
4
by: Jacek Jurkowski | last post by:
.... the minimum date of DateTimePicker is 1753-01-01. How to make DateTime to do not show nothing in its text if this date is the value? I have a form with a field LastLogonDate. If user hasn't...
1
by: andrewcw | last post by:
Simple question, my control has a default form of the day of the week then month, etc. How can I get it to show something like dateTimePicker.Value.ToShortDateString() which is like...
4
by: Maria | last post by:
I've tried to search for a way to set a datetimepicker.value to nothing. I would like it to display nothing until the user select a value.. I know you can use a checkbox to disable the control -...
0
by: simchajoy2000 | last post by:
Hi, I have a VB.NET form with several DateTimePickers on it. These have worked great for me until several days ago. All of a sudden they no longer recognize user input. So if a user enters a...
7
by: Clamara | last post by:
When adding a new record from my form, I pre-set my DateTimePicker's value to System.DateTime.Today Since the "Today" value is used most of the time, the user doesn't need to select a date from...
3
by: Simon Tamman | last post by:
I've come across an interesting bug. I have workarounds but i'd like to know the root of the problem. I've stripped it down into a short file and hope someone might have an idea about what's going...
1
by: Kevin | last post by:
I have put a VS2005 sample project up here: http://www.kevinandkiran.com/CSharpApplication.zip (its only 50k) Basically I have a class that contains a date property, which is initialised to...
4
by: jehugaleahsa | last post by:
Hello: We were hoping to allow users to have DateTimePicker value null so that a unused date is stored on a Database. Does the control support this? I am pretty sure it doesn't. How would you...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.