?? form8.frm
字號:
VERSION 5.00
Object = "{DAAC6951-59A4-4C08-9D6E-FE3919B64861}#1.0#0"; "FlexCell.ocx"
Begin VB.Form Form8
Caption = "成績統(tǒng)計圖表"
ClientHeight = 5340
ClientLeft = 60
ClientTop = 450
ClientWidth = 7815
Icon = "Form8.frx":0000
LinkTopic = "Form8"
ScaleHeight = 5340
ScaleWidth = 7815
StartUpPosition = 1 '所有者中心
Begin FlexCell.Grid Grid1
Height = 4815
Left = 240
TabIndex = 0
Top = 240
Width = 7335
_ExtentX = 12938
_ExtentY = 8493
Appearance = 0
Cols = 5
Rows = 30
End
End
Attribute VB_Name = "Form8"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private mblnChanged As Boolean
Dim i, j As Integer
Private Sub Form_Load()
On Error GoTo finish
Grid1.SetRegisterInformation "CNwinndy", "W]vyY-nonvk-u\nty-Zbl_e-`hms^" '進行注冊
Dim i As Long
Dim ac1, ac2, ac3, ac4, ac5 As Integer
Grid1.AutoRedraw = False
Grid1.CellBorderColorFixed = vbButtonShadow
Grid1.FixedRowColStyle = Flat
Grid1.Rows = 3
Grid1.Cols = 2
Grid1.RowHeight(1) = 30
For i = 1 To 1
Grid1.Column(i).Width = 70
Next
Set qy1 = cnn.Execute("select 課程名稱 from 課程")
Do While Not qy1.EOF
Grid1.Cols = Grid1.Cols + 1
Grid1.Cell(2, Grid1.Cols - 1).Text = qy1.Fields(0)
qy1.MoveNext
Loop
'設(shè)置單元格文字
Grid1.Cell(1, 1).Text = tbbm1 '圖表的表名稱
Grid1.Cell(2, 1).Text = "姓 名"
tbsql1 = "select 名字 from 學(xué)生信息 where 班級='" & Class & "' order by 學(xué)號 asc"
Set qy1 = cnn.Execute(tbsql1)
Do While Not qy1.EOF
Grid1.Rows = Grid1.Rows + 1
Grid1.Cell(Grid1.Rows - 1, 1).Text = qy1.Fields(0)
qy1.MoveNext
Loop
For j = 2 To Grid1.Cols - 1
For i = 3 To Grid1.Rows - 1
tbsql1 = "SELECT 成績 from 學(xué)生信息,學(xué)生與課程 where 名字='" & Grid1.Cell(i, 1).Text & "' and 班級='" & Class & "' and 課程名稱='" & Grid1.Cell(2, j).Text & "' order by 學(xué)生信息.學(xué)號 asc"
Set qy1 = cnn.Execute(tbsql1)
Do While Not qy1.EOF
Grid1.Cell(i, j).Text = qy1.Fields(0)
qy1.MoveNext
Loop
Next
Next
For i = 1 To Grid1.Cols - 1
Grid1.Column(i).Width = 90
Next
'設(shè)置單元格格式
Grid1.Cell(1, 1).Font.SIZE = 12
Grid1.Range(1, 1, 1, Grid1.Cols - 1).Merge
Grid1.Range(1, 1, Grid1.Rows - 1, 1).Alignment = cellCenterCenter
Grid1.Range(2, 1, Grid1.Rows - 1, Grid1.Cols - 1).Alignment = cellCenterCenter
'Grid1.Range(3, 2, Grid1.Rows - 1, Grid1.Cols - 1).Alignment = cellRightCenter
Grid1.Range(2, 1, Grid1.Rows - 1, Grid1.Cols - 1).BackColor = RGB(90, 158, 214)
Grid1.Range(2, 1, Grid1.Rows - 1, 1).BackColor = vbYellow
With Grid1.Range(1, 1, Grid1.Rows - 1, Grid1.Cols - 1)
.Borders(cellEdgeLeft) = cellThin
.Borders(cellEdgeRight) = cellThin
.Borders(cellEdgeTop) = cellThin
.Borders(cellEdgeBottom) = cellThin
.Borders(cellInsideHorizontal) = cellThin
.Borders(cellInsideVertical) = cellThin
End With
Grid1.PageSetup.CenterHorizontally = True
'設(shè)置打印區(qū)域
Grid1.PageSetup.PrintRows = Grid1.Rows - 1
Grid1.PageSetup.PrintColumns = Grid1.Cols - 1
Grid1.AutoRedraw = True
Grid1.Refresh
Exit Sub
finish:
If qy1.EOF = True Then
MsgBox "無任何對應(yīng)數(shù)據(jù)!"
Exit Sub
Else
MsgBox Err.Description
End If
End Sub
Private Sub Form_Resize()
If Me.WindowState <> 1 Then
Grid1.Left = 240
Grid1.Width = Me.Width - 480
Grid1.Top = 240
Grid1.Height = Me.Height - 960
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -