Description
Sets the maximum and minimum date limits for the calendar.
Applies to
MonthCalendar control
Syntax
controlname.SetDateLimits ( min, max )
| 
                                            
                               Argument  | 
                           
                                            
                               Description  | 
                        
|---|---|
| 
                                            
                               controlname  | 
                           
                                            
                               The name of the MonthCalendar control for which you want to set the date limits  | 
                        
| 
                                            
                               min  | 
                           
                                            
                               A date value to be set as the minimum date that can be referenced or displayed in the calendar  | 
                        
| 
                                            
                               max  | 
                           
                                            
                               A date value to be set as the maximum date that can be referenced or displayed in the calendar  | 
                        
Return value
Integer.
Returns 0 when both limits are set successfully and one of the following negative values otherwise:
-1 -- Invalid arguments
-2 -- Unknown failure
Usage
Use the SetDateLimits function to set minimum and maximum dates. SetDateLimits uses the maximum date as the minimum date and vice versa if you set a maximum date that is earlier than the minimum date.
Examples
This example sets the minimum and maximum dates for a control using today's date as the minimum date and a date specified in an EditMask control as the maximum date:
integer li_return Date mindate, maxdate mindate = Today() maxdate = Date(em_1.Text) li_return = mc_1.SetDateLimits(mindate, maxdate)
See also


