| '加載主界面表單 Private Sub FormMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load With Me.DGV_GpHqFind .EnableHeadersVisualStyles = False '行標(biāo)題和列標(biāo)題是否使用用戶當(dāng)前主題式樣 .ColumnHeadersDefaultCellStyle.Font = New Font("微軟雅黑", 10, FontStyle.Regular) '標(biāo)題字體 .RowsDefaultCellStyle.Font = New Font("微軟雅黑", 10, FontStyle.Regular) '表格字體 .ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter '標(biāo)題居中 .RowsDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight '表格文字靠右對齊 .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells '設(shè)定包括Header和所有單元格的列寬自動調(diào)整 .AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells '設(shè)定包括Header和所有單元格的行高自動調(diào)整 .ColumnHeadersDefaultCellStyle.ForeColor = Color.MidnightBlue '設(shè)定標(biāo)題欄字體顏色 .ColumnHeadersDefaultCellStyle.BackColor = Color.AliceBlue '設(shè)定標(biāo)題欄背景顏色 '.Columns(5).DefaultCellStyle.ForeColor = Color.Red '設(shè)定第5列的字體顏色 '.Columns(4).DefaultCellStyle.BackColor = Color.Blue '設(shè)定第5列的字體顏色 '.Rows(2).DefaultCellStyle.ForeColor = Color.Red '設(shè)定第2行的字體顏色 '.Rows(2).DefaultCellStyle.BackColor = Color.Blue '設(shè)定第2行的背景顏色 '.Item(6, 2).Style.BackColor = Color.FromArgb(255, 180, 255) '設(shè)定指定單元格背景顏色 '.Item(3, 0).Style.ForeColor = Color.FromArgb(0, 240, 80) '設(shè)定指定單元格字體顏色 '.Columns(4).SortMode = DataGridViewColumnSortMode.Programmatic '排序模式 .AllowUserToAddRows = False '不顯示最下面的新行 End With Menu_Main.Location = New Point(0, 0) '主菜單位置 Tools_Main.Location = New Point(3, 27) '主工具欄位置 Tools_Sub.Location = New Point(Tools_Main.Width + 5, 27) '次工具欄位置 '綁定圖標(biāo)列表 For i = 0 To Tools_Main.Items.Count - 1 If Not Tools_Main.Items(i).GetType.Name = "ToolStripLabel" Then 'ToolStripButton Tools_Main.Items(i).Image = ImageListTools_Main.Images.Item(i) End If Next For i = 0 To Tools_Sub.Items.Count - 1 If Not Tools_Sub.Items(i).GetType.Name = "ToolStripLabel" Then Tools_Sub.Items(i).Image = ImageListTools_Sub.Images.Item(i + 5) End If Next End Sub | 
|  |