VBA 代码逐句翻译:分页、日期选择和初始化
Private Sub LastPage__Click() ' 声明一个整型变量 S Dim S As Integer ' 设置 Right_ 按钮不可用 Right_.Enabled = False ' 设置 LastPage_ 按钮不可用 LastPage_.Enabled = False ' 设置 Left_ 按钮可用 Left_.Enabled = True ' 设置 HomePage_ 按钮可用 HomePage_.Enabled = True ' 计算页数并赋值给 S S = Int(Count / (DisplayCount + 1)) * (DisplayCount + 1) ' 将 S 赋值给 StartRow_ StartRow_ = S ' 将 Count 赋值给 EndRow_ EndRow_ = Count ' 调用 AddListView 方法 AddListView End Sub
Private Sub StartDate__MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single) ' 声明一个日期变量 dateValue Dim dateValue As Date ' 如果鼠标左键单击 If Button = 1 Then ' 从 CalendarForm 获取日期值并赋值给 dateValue dateValue = CalendarForm.GetDate ' 如果 dateValue 大于 0 If dateValue > 0 Then ' 将 dateValue 赋值给 StartDate_ 的 Text 属性 StartDate_.Text = dateValue End If End If End Sub
Private Sub EndDate__MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single) ' 声明一个日期变量 dateValue Dim dateValue As Date ' 如果鼠标左键单击 If Button = 1 Then ' 从 CalendarForm 获取日期值并赋值给 dateValue dateValue = CalendarForm.GetDate ' 如果 dateValue 大于 0 If dateValue > 0 Then ' 将 dateValue 赋值给 EndDate_ 的 Text 属性 EndDate_.Text = dateValue End If End If End Sub
Private Sub Class_Initialize() ' 设置 AddMethodName_ 为 'Add' AddMethodName_ = 'Add' ' 创建一个新的 Collection 对象并赋值给 ListControls Set ListControls = New Collection End Sub
原文地址: https://www.cveoy.top/t/topic/lCBL 著作权归作者所有。请勿转载和采集!