'宣言 Public Event BeforeDropDown As CancelEventHandler
public event CancelEventHandler BeforeDropDown
イベント ハンドラが、このイベントに関連するデータを含む、CancelEventArgs 型の引数を受け取りました。次の CancelEventArgs プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 解説 |
---|---|
Cancel |
カレンダー ドロップダウンが表示される前だが初期化された後に BeforeDropDownイベントが発生します。ドロップダウンが表示されないようにするために使用できます。この動作は、System.ComponentModel.CancelEventArgs.Cancel プロパティを True に設定することで変更できます。
Private Sub UltraCalendarCombo1_BeforeDropDown(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ultraCalendarCombo1.BeforeDropDown ' The BeforeDropDown event is a "cancelable" event, ' which means that the action to which it corresponds can be ' prevented from happening by canceling the event. ' ' Canceling an event is very simple - just set the 'Cancel' ' property of the event arguments to true. The action will then ' be prevented from happening, and the corresponding "After" ' event will not fire. ' Disallow the displaying of the dropdown calendar for weekend ' days by canceling the event if the current date is a Saturday ' or Sunday If (DateTime.Today.DayOfWeek = System.DayOfWeek.Saturday Or _ DateTime.Today.DayOfWeek = System.DayOfWeek.Sunday) Then e.Cancel = True End If End Sub
private void ultraCalendarCombo1_BeforeDropDown(object sender, System.ComponentModel.CancelEventArgs e) { // The BeforeDropDown event is a "cancelable" event, // which means that the action to which it corresponds can be // prevented from happening by canceling the event. // // Canceling an event is very simple - just set the 'Cancel' // property of the event arguments to true. The action will then // be prevented from happening, and the corresponding "After" // event will not fire. // Disallow the displaying of the dropdown calendar for weekend // days by canceling the event if the current date is a Saturday // or Sunday if ( DateTime.Today.DayOfWeek == System.DayOfWeek.Saturday || DateTime.Today.DayOfWeek == System.DayOfWeek.Sunday ) e.Cancel = true; }