项目事件
AfterOpenProject
MainTable = Tables("表A")
Forms("窗口1").Open()
计划管理
表事件
表A_AfterLoadTableSetting
Tables("表A").SetHeaderRowHeight(30,30)
'行高设置
Dim t As Table = Tables("表A")
t.DefaultRowHeight = 30 '所有行高
窗口表事件
窗口与控件事件
窗口1_AfterLoad
'网格线颜色
Tables("表A").Grid.Styles("Normal").Border.Color = Color.SteelBlue
窗口1_Button1_Click
Dim Filter As String
With e.Form.Controls("所属机构")
If .Value IsNot Nothing Then
Filter = "第一列 = '" & .Value & "'"
End If
End With
With e.Form.Controls("起始日期")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "第三列 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("截止日期")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "第四列 <= #" & .Value & "#"
End If
End With
If Filter > "" Then
Tables("表A").Filter = Filter
End If
窗口1_Button2_Click
Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog
dlg.Filter= "Excel文件|*.xls" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then
Dim ccb As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox1")
Dim ws As String = Tables("表A").getColVisibleWidth
If ccb.Text > "" Then
Dim lst As new List(of String)
lst.AddRange(ccb.Text.Split(","))
For Each c As Col In Tables("表A").Cols
c.Visible = lst.Contains(c.Name)
Next
End If
Dim flg As New SaveExcelFlags
flg.RowNumber = True
flg.CellStyle = True
flg.VisibleOnly = True
Tables("表A").SaveExcel(dlg.FileName,"表A",flg)
Tables("表A").SetColVisibleWidth(ws)
Dim Proc As New Process
Proc.File = dlg.FileName
Proc.Start()
End If
窗口1_Button3_Click
Dim sbxh As WinForm.ComboBox = e.Form.Controls("所属机构")
Dim StartDate As WinForm.DateTimePicker = e.Form.Controls("起始日期")
Dim EndDate As WinForm.DateTimePicker = e.Form.Controls("截止日期")
sbxh.Text = ""
StartDate.Value =""
EndDate.Value =""
Tables("表A").ApplyFilter = False
'Tables("中标统计").Sort = "项目编码"
窗口1_CheckedComboBox1_Enter
e.sender.Items.Clear
For Each c As Col In Tables("表A").Cols
e.sender.Items.add(c.name)
Next
窗口1_所属机构_Enter
e.Sender.ComboList=DataTables("表A").GetComboListString("第一列")
自定义函数
全局代码
菜单事件