By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,700 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

reset the initial value of a datetimepicker control

P: n/a
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 System.Object, ByVal e As
System.EventArgs) Handles dateDebut.ValueChanged

if dateDebut.value.date < refDate then

<message>

<reset tho initial value>......how to do this?????????

end if

end sub

Any help please??

Thanks.
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"toufik" <to*****@sympatico.ca> schrieb
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 System.Object,
ByVal e As System.EventArgs) Handles dateDebut.ValueChanged

if dateDebut.value.date < refDate then

<message>

<reset tho initial value>......how to do this?????????

end if

end sub


What is the "initial value"? The current date? If yes:

datedebut.value = date.today
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

P: n/a
Thanks, but I mean the value that was there before I change it.

"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"toufik" <to*****@sympatico.ca> schrieb
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 System.Object,
ByVal e As System.EventArgs) Handles dateDebut.ValueChanged

if dateDebut.value.date < refDate then

<message>

<reset tho initial value>......how to do this?????????

end if

end sub


What is the "initial value"? The current date? If yes:

datedebut.value = date.today
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3

P: n/a
* "toufik" <to*****@sympatico.ca> scripsit:
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 System.Object, ByVal e As
System.EventArgs) Handles dateDebut.ValueChanged

if dateDebut.value.date < refDate then

<message>

<reset tho initial value>......how to do this?????????


Add a private variable of type 'Date' and assign the datetimepicker's
value to this variable if its valid. Then you can restore it easily if
an invalid date is selected.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

P: n/a
"toufik" <to*****@sympatico.ca> schrieb

What is the "initial value"? The current date? If yes:

datedebut.value = date.today


Thanks, but I mean the value that was there before I change it.


see Herfried's answer
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.