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

DateTimePicker and visibility to Min/Max Dates.

Greetings group,

I have a situation where I'd like to visibly see disabled dates on a
DateTimePicker. Frequently the Min and Max dates in the picker will be
set only to days apart, and so I would like this to be reflected in a
way other than it simply failing to select when they click. It seems
like this would be doable with a MonthCalendar control, however the
DateTimePicker itself doesn't seem to expose an internal MonthCalendar,
nor does it provide any kind of hihglighting options.

I'm open to any/all crazy suggestions. :)

Chris.
Sep 21 '07 #1
12 7259
Hi,

"Chris Shepherd" <ch**@nospam.chsh.cawrote in message
news:uA**************@TK2MSFTNGP06.phx.gbl...
Greetings group,

I have a situation where I'd like to visibly see disabled dates on a
DateTimePicker. Frequently the Min and Max dates in the picker will be set
only to days apart, and so I would like this to be reflected in a way
other than it simply failing to select when they click. It seems like this
would be doable with a MonthCalendar control, however the DateTimePicker
itself doesn't seem to expose an internal MonthCalendar, nor does it
provide any kind of hihglighting options.

I'm open to any/all crazy suggestions. :)
IIRC you can control how each cell will looks like in the control. You
could set the CssClass to a style that the text is not visible. So it will
be "invisible"
Sep 21 '07 #2
OZI

This must be for a WinForm, I don't see CssClass.
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:uX*************@TK2MSFTNGP06.phx.gbl...
Hi,

"Chris Shepherd" <ch**@nospam.chsh.cawrote in message
news:uA**************@TK2MSFTNGP06.phx.gbl...
>Greetings group,

I have a situation where I'd like to visibly see disabled dates on a
DateTimePicker. Frequently the Min and Max dates in the picker will be
set only to days apart, and so I would like this to be reflected in a way
other than it simply failing to select when they click. It seems like
this would be doable with a MonthCalendar control, however the
DateTimePicker itself doesn't seem to expose an internal MonthCalendar,
nor does it provide any kind of hihglighting options.

I'm open to any/all crazy suggestions. :)

IIRC you can control how each cell will looks like in the control. You
could set the CssClass to a style that the text is not visible. So it will
be "invisible"

Sep 21 '07 #3
OZI
Are you saying MinDate and MaxDate properties will not do it for you?
"Chris Shepherd" <ch**@nospam.chsh.cawrote in message
news:uA**************@TK2MSFTNGP06.phx.gbl...
Greetings group,

I have a situation where I'd like to visibly see disabled dates on a
DateTimePicker. Frequently the Min and Max dates in the picker will be set
only to days apart, and so I would like this to be reflected in a way
other than it simply failing to select when they click. It seems like this
would be doable with a MonthCalendar control, however the DateTimePicker
itself doesn't seem to expose an internal MonthCalendar, nor does it
provide any kind of hihglighting options.

I'm open to any/all crazy suggestions. :)

Chris.

Sep 21 '07 #4
Hi,

"OZI" <sq**********@hotmail.comwrote in message
news:ee**************@TK2MSFTNGP06.phx.gbl...
>
This must be for a WinForm, I don't see CssClass.
My bad, I though it was for a web app.

But still the idea is valid, just to try to have the same color of the
font/background in the needed cells.
Sep 21 '07 #5
OZI wrote:
Are you saying MinDate and MaxDate properties will not do it for you?
Nope, try it yourself. Just add a DateTimePicker and a MinDate and
MaxDate, and for me, by default, it simply means the user can't click
those dates once the MonthCalendar control has dropped down. Visibly
there isn't a difference between a valid date in the current month and
an invalid date in the current month.

Chris.
Sep 21 '07 #6
Ignacio Machin ( .NET/ C# MVP ) wrote:
IIRC you can control how each cell will looks like in the control. You
could set the CssClass to a style that the text is not visible. So it will
be "invisible"
This isn't a web control, but a WinForms control.

Chris.
Sep 21 '07 #7
Ignacio Machin ( .NET/ C# MVP ) wrote:
My bad, I though it was for a web app.

But still the idea is valid, just to try to have the same color of the
font/background in the needed cells.
The trouble is visibility to those cells.

Chris.
Sep 21 '07 #8
OZI
Yes the Idea is valid in theory and thin air. I don't see how to control
each individual day format.
It is not available like on in the web control.
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:eK**************@TK2MSFTNGP04.phx.gbl...
Hi,

"OZI" <sq**********@hotmail.comwrote in message
news:ee**************@TK2MSFTNGP06.phx.gbl...
>>
This must be for a WinForm, I don't see CssClass.

My bad, I though it was for a web app.

But still the idea is valid, just to try to have the same color of the
font/background in the needed cells.

Sep 21 '07 #9
OZI
Okay so what you want to do with the invalid dates is to make them
invisible.
There must be a way to override the rendering, but I don't see how now.
"Chris Shepherd" <ch**@nospam.chsh.cawrote in message
news:OP**************@TK2MSFTNGP03.phx.gbl...
OZI wrote:
>Are you saying MinDate and MaxDate properties will not do it for you?

Nope, try it yourself. Just add a DateTimePicker and a MinDate and
MaxDate, and for me, by default, it simply means the user can't click
those dates once the MonthCalendar control has dropped down. Visibly there
isn't a difference between a valid date in the current month and an
invalid date in the current month.

Chris.

Sep 21 '07 #10
OZI
this might help or give you some direction

http://www.codeproject.com/cs/miscct...timepicker.asp
"Chris Shepherd" <ch**@nospam.chsh.cawrote in message
news:OP**************@TK2MSFTNGP03.phx.gbl...
OZI wrote:
>Are you saying MinDate and MaxDate properties will not do it for you?

Nope, try it yourself. Just add a DateTimePicker and a MinDate and
MaxDate, and for me, by default, it simply means the user can't click
those dates once the MonthCalendar control has dropped down. Visibly there
isn't a difference between a valid date in the current month and an
invalid date in the current month.

Chris.

Sep 21 '07 #11
Hi,

"OZI" <sq**********@hotmail.comwrote in message
news:O4**************@TK2MSFTNGP02.phx.gbl...
Yes the Idea is valid in theory and thin air. I don't see how to control
each individual day format.
It is not available like on in the web control.
You are right, it's not available.

You will have to do it yourself. Before doing that I advise you to google
aroudn for projects, this may be asked and answered before.
For example a query of datetimepicker color in google returned this:
http://www.codeproject.com/cs/miscct...timepicker.asp

Otherwise take a look at some commercial options like Infragistics.
Infragistics implement a kind of CSS for windows controls that is super
cool, You can change the look of your application on the fly and the
controls are very configurable
Sep 21 '07 #12
Ignacio Machin ( .NET/ C# MVP ) wrote:
You will have to do it yourself. Before doing that I advise you to google
aroudn for projects, this may be asked and answered before.
For example a query of datetimepicker color in google returned this:
http://www.codeproject.com/cs/miscct...timepicker.asp
Yeah, I had googled and found several similar but not quite examples of
other controls. I was just wondering if there was some kind of simpler
method that I had somehow missed.
Otherwise take a look at some commercial options like Infragistics.
Infragistics implement a kind of CSS for windows controls that is super
cool, You can change the look of your application on the fly and the
controls are very configurable
Looks cool, I may have to see if management will go for it.

Chris.
Sep 21 '07 #13

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

Similar topics

0
by: Tom Rahav | last post by:
Hi. I have a DateTimePicker on a win form in VB.NET 2003, and I have a database table that contains different dates as records. What I want to do is detect what dates are exist in the database,...
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...
7
by: Edward Mitchell | last post by:
I have a number of DateTimePicker controls, some set to dates, some set to a format of Time. The controls are all embedded in dialogs. I created the controls by dragging the DateTime picker from...
3
by: Jeronimo Bertran | last post by:
Is there any edit box type control that allows dates to be entered? Something similar to the DateTimePicker in Windows Forms? Thanks, Jeronimo
1
by: Brett Baisley | last post by:
Hello I am using two datetimepicker controls to allow the user to select two dates. I've called them dateIn and dateOut. After they pick the dateIn, I want to set its Leave method to...
2
by: Atley | last post by:
Is there a way to use the DateTimePicker to pick a time or is it just used to pick dates? If so, why is it called DATEtimepicker?
2
by: Chris Fairman | last post by:
NG, Maybe I'm missing a key step, but it seems when typing dates into a DateTimePicker control (format = 'Short'), the controls' .text property is not updated until the control losses focus. ...
1
by: Jesse | last post by:
Hi, I am working on datetimepicker and want make the dates out of my range disabled. There are APIs that I have used: minDate, maxDate. It works fine. However, users can not tell which date can't...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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,...

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.