Q: DatePicker

G

G .Net

Hi

Can anybody help me with setting the allowable Max and Min date for a
DatePicker?

I would like to restrict the possible date selections to a given month. So
for example, if I were to specify Jan 06 the datepicker could not display
days Feb 06 i.e. the arrows for next month and earlier month would not do
anything.

I understand that I could use DatePicker MinDate and MaxDate but how do I
set these without explicitly setting, for example, 01/01/06 - 31/01/06.

Thanks in advance

Geoff
 
L

Larry Lard

G said:
Hi

Can anybody help me with setting the allowable Max and Min date for a
DatePicker?

I would like to restrict the possible date selections to a given month. So
for example, if I were to specify Jan 06 the datepicker could not display
days Feb 06 i.e. the arrows for next month and earlier month would not do
anything.

I understand that I could use DatePicker MinDate and MaxDate but how do I
set these without explicitly setting, for example, 01/01/06 - 31/01/06.

' to restrict a DatePicker named dtp to the month of:
Dim month As Integer = 1
Dim year As Integer = 2006

dtp.MinDate = New Date(year, month, 1)
dtp.MaxDate = dtp.MinDate.AddMonths(1).AddDays(-1)
 
G

G .Net

Hi Larry

Many thanks for that.

Geoff

Larry Lard said:
' to restrict a DatePicker named dtp to the month of:
Dim month As Integer = 1
Dim year As Integer = 2006

dtp.MinDate = New Date(year, month, 1)
dtp.MaxDate = dtp.MinDate.AddMonths(1).AddDays(-1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top