Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/05/2005, 16:34
MaxExtreme
 
Fecha de Ingreso: abril-2005
Mensajes: 3.083
Antigüedad: 19 años, 1 mes
Puntos: 17
Cita:
Iniciado por http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingmonthviewcontrol.asp
Selecting A Range of Dates

You can use the MonthView control to display a contiguous range of dates, or to allow the user to select a date range. In order to extend the selection to more than one date, the MultiSelect property must be set to True. You can control the maximum number of days that may be selected by changing the value of the MaxSelCount property. By default, the maximum selection allowed is seven days.

The SelStart and SelEnd properties determine which days are selected. You can check the values of these properties to find out what range the user has selected. If only one date is selected, the two values will be the same. You can also set the values of these properties in code, which will cause a range of dates to become selected in the control. When setting the SelStart and SelEnd properties through code, you must observe the following rules:

* The SelStart date must occur before the SelEnd date.

* The selected range must contain the currently selected date. If necessary, you should set the Value property to one of the dates in the range before setting the SelStart and SelEnd values.

* The number of dates included in the range cannot exceed the maximum range size as specified by MaxSelCount.

For example, to select the week before Halloween through code, you would use the following:

Código:
MonthView1.Value = "10/31/97"
MonthView1.MaxSelCount = 7
MonthView1.SelStart = "10/25/97"
MonthView1.SelEnd = "10/31/97"
Según eso no tiene mayor complicación. Resumiendo:
- MultiSelect debe ser True
- La selección debe ser menor o igual que MaxSelCount
- En SelStart se almacena la fecha inicial y en SelEnd la final

Pruébalo con

Código:
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
	MsgBox MonthView1.SelStart
	MsgBox MonthView1.SelEnd
End Sub