www.pudn.com > new xsc.rar > frmteacher.frm


VERSION 5.00 
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX" 
Begin VB.Form frmteacher  
   Caption         =   "班主任管理" 
   ClientHeight    =   6090 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   8880 
   Icon            =   "frmteacher.frx":0000 
   LinkTopic       =   "Form1" 
   MDIChild        =   -1  'True 
   ScaleHeight     =   6090 
   ScaleWidth      =   8880 
   Begin VB.Frame Frame1  
      Caption         =   "执行操作" 
      Height          =   1215 
      Left            =   240 
      TabIndex        =   2 
      Top             =   4680 
      Width           =   8535 
      Begin VB.CommandButton Command3  
         Caption         =   "刷新班主任信息列表" 
         Height          =   495 
         Left            =   5760 
         TabIndex        =   5 
         Top             =   480 
         Width           =   2295 
      End 
      Begin VB.CommandButton Command2  
         Caption         =   "修改班主任信息" 
         Height          =   495 
         Left            =   3420 
         TabIndex        =   4 
         Top             =   480 
         Width           =   2295 
      End 
      Begin VB.CommandButton Command1  
         Caption         =   "添加班主任信息" 
         Height          =   495 
         Left            =   1080 
         TabIndex        =   3 
         Top             =   480 
         Width           =   2295 
      End 
   End 
   Begin MSFlexGridLib.MSFlexGrid datagrid1  
      Height          =   2175 
      Left            =   2280 
      TabIndex        =   1 
      Top             =   2160 
      Width           =   4455 
      _ExtentX        =   7858 
      _ExtentY        =   3836 
      _Version        =   393216 
   End 
   Begin VB.Label Label1  
      Caption         =   "班 主 任 信 息 列 表" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   15 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   2880 
      TabIndex        =   0 
      Top             =   240 
      Width           =   3615 
   End 
End 
Attribute VB_Name = "frmteacher" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Private Sub Command1_Click() 
  frmaddteacher.Show 
End Sub 
 
Private Sub Command2_Click() 
 frmup.Show 
End Sub 
 
Private Sub Command3_Click() 
  datagrid1.Refresh 
  Me.Hide 
  Me.Show 
End Sub 
 
Private Sub Form_Load() 
showtitle 
showData 
Me.Height = 6495 
Me.Width = 9000 
End Sub 
 
Private Sub Form_Resize() 
   If Me.WindowState <> vbMinimized And frmmdi.WindowState <> vbMinimized Then 
     If Me.ScaleHeight < 10 * Label1.Height Then 
       Exit Sub 
     End If 
     If Me.ScaleWidth < Label1.Width * 1.5 Then 
       Exit Sub 
     End If 
  Label1.Top = Label1.Height 
  Label1.Left = (Me.Width - Label1.Width) / 2 
  datagrid1.Top = Label1.Top + Label1.Height + Label1.Height / 2 
  datagrid1.Width = Me.ScaleWidth - 200 
  datagrid1.Left = Me.ScaleLeft + 100 
  datagrid1.Height = Me.ScaleHeight - datagrid1.Top - 1500 
  Frame1.Top = datagrid1.Top + datagrid1.Height + 50 
  Frame1.Left = Me.ScaleLeft + 300 
  Frame1.Width = Me.ScaleWidth - 600 
  End If 
End Sub 
Private Sub showData() 
  Dim j As Integer 
  Dim i As Integer 
  Dim msgtext As String 
  Set mrc = ExecuteSQL("select class,name1,tel,zaizhi,start,biyeban,nianshu from teacher", msgtext) 
  With datagrid1 
  .Rows = 1 
  Do While Not mrc.EOF 
     .Rows = .Rows + 1 
     For i = 1 To mrc.Fields.Count 
       If Not IsNull(Trim(mrc.Fields(i - 1))) Then 
          .TextMatrix(.Row, i) = mrc.Fields(i - 1) 
       End If 
     Next i 
     mrc.MoveNext 
  Loop 
  End With 
  mrc.Close 
End Sub 
Private Sub showtitle() 
 Dim i As Integer 
 With datagrid1 
 .Cols = 8 
 .TextMatrix(0, 1) = "班级" 
 .TextMatrix(0, 2) = "姓名" 
 .TextMatrix(0, 3) = "电话" 
 .TextMatrix(0, 4) = "是否在职" 
 .TextMatrix(0, 5) = "开始工作时间" 
 .TextMatrix(0, 6) = "是否毕业班" 
 .TextMatrix(0, 7) = "工作年数" 
 .FixedRows = 1 
 For i = 0 To 7 
    .ColAlignment(i) = 0 
 Next i 
 .FillStyle = flexFillRepeat 
 .Col = 0 
 .Row = 0 
 .RowSel = 1 
 .ColSel = .Cols - 1 
 .CellAlignment = 4 
 .ColWidth(0) = 500 
 .ColWidth(1) = 1500 
 .ColWidth(2) = 1500 
 .ColWidth(3) = 1500 
 .ColWidth(4) = 1500 
 .ColWidth(5) = 1500 
 .ColWidth(6) = 1500 
 .ColWidth(7) = 1500 
 .Row = 1 
 End With 
  
End Sub