操作回顧
這個示例依賴於Deleting事件在實際操作之前觸發的事實
Protected Sub DetailsDataSource_Deleting(ByVal sender As Object
可以看到
首先進行一些變量聲明
Dim today As DateTime = DateTime
Dim startYear As Integer
Dim endYear As Integer
Dim seasonStart As DateTime
Dim seasonEnd As DateTime
第一行代碼將當前日期賦給today變量
為了判斷賽季開始和結束的年份
If today
startYear = today
endYear = today
Else
startYear = today
endYear = today
End If
接下來創建這個賽季的實際開始和結束日期
seasonStart = New DateTime(startYear
seasonEnd = New DateTime(endYear
[
From:http://tw.wingwit.com/Article/program/net/201311/14657.html