473,402 Members | 2,072 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,402 software developers and data experts.

How to display only date with DateTimePicker control

cardei
5
Hi, I need some help ... (Visual Basic 2008 Express)
I have the next line of code :

Expand|Select|Wrap|Line Numbers
  1. Form2.Label54.Text = DateTimePicker1.Value
when I change the date on DateTimePiker control label54 display date an hour.

I change the format of DateTimePiker to short or custom but i get the same thing.

I need to display only the date selected.

Thanks.
Mar 1 '08 #1
2 4083
Zitomd
2
Hi, I need some help ... (Visual Basic 2008 Express)
I have the next line of code :

Expand|Select|Wrap|Line Numbers
  1. Form2.Label54.Text = DateTimePicker1.Value
when I change the date on DateTimePiker control label54 display date an hour.

I change the format of DateTimePiker to short or custom but i get the same thing.

I need to display only the date selected.

Thanks.
Form2.Label54.Text = DateTimePicker1.Text Would result in Saturday, March 1, 2008 on my form but if your looking to get rid of the weekday then;

Another option is
Form2.Label54.Text = DateTimePicker1.Value.Date Would result in 3/1/2008

Otherwise you could build the string
strDate = DateTimePicker1.Value.Month
strDate = strDate & "-" & DateTimePicker1.Value.Day
strDate = strDate & "-" & DateTimePicker1.Value.Year

Form2.Label54.Text = strDate Would result in 3-1-2008
Mar 2 '08 #2
cardei
5
Thanks a lot Zitomd

It's what I need
Mar 7 '08 #3

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

Similar topics

9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
4
by: toufik | last post by:
Hi, In the ValueChanged event of a dateTimePicker control I've a condition, and I like to reset the initial value if teh condition is false Private Sub dateDebut_ValueChanged(ByVal sender As...
0
by: Reny J Joseph Thuthikattu | last post by:
hi, i want to display my datetimepicker control ,which display in georgian callender format,in it's arabic form.for example i want to display january 29 ,2005 in it's arabic form( i don't know...
3
by: Reny J Joseph Thuthikattu | last post by:
Hi, If i put a month callender on a asp.net web form and specify the culture on the page directive like '<%@ Page language="c#" Culture="ar-OM"%> it will display the Month callender in arabic. ...
5
by: Alpha | last post by:
I have a DateTimePicker control that originally displays "1/1/1900" on screen. I want to change it to current date when a user clicks on it. I use the follow code but nothing is happening. Can...
0
by: Kumar R | last post by:
How to disable the specific date in the DateTimePicker control. suppose i want to disable all sundays and saturdays of the particular month. how to do? i search in the many sites, but i didn't find...
0
by: thull | last post by:
I'm trying to modify an older VB6 program and use the DateTimePicker control to give the user the ability to display and modify the system date and time. The VB6 documentation says it is available...
2
by: ruvi | last post by:
Hi, I have a datetimepicker control in my form. It works fine except for one thing- Its default value is automatically set to today's date. I want the control to be blank when the form loads....
2
by: Todd Carnes | last post by:
I am trying to write an app in C# that requires the user to enter a date from 4000 B.C.E to 4000 C.E. I tried to use the DateTimePicker Control to allow the user to enter the date, but it only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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.