⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmstsi.frm

📁 明星档案管理系统,学生自己制作的,适合于全日制在校大学生,得了个优哦
💻 FRM
📖 第 1 页 / 共 3 页
字号:
    txtSQL = "delete from starinfo_Form where starinfo_NO='" & Trim(Text1(0)) & "'"
    Set mrc = ExecuteSQL(txtSQL, MsgText)
    MsgBox "明星档案已经删除!", vbOKOnly, "提示"
    j = 0
    For i = 1 To MSFlexGrid1.Rows - 1
        If MSFlexGrid1.TextMatrix(i, 0) = Text1(0) Then
            j = i
        End If
    Next
    If j <> 0 Then
        MSFlexGrid1.TextMatrix(j, 0) = "已删除"
        MSFlexGrid1.TextMatrix(j, 1) = "已删除"
        MSFlexGrid1.TextMatrix(j, 2) = "已删除"
        MSFlexGrid1.TextMatrix(j, 3) = "已删除"
        MSFlexGrid1.TextMatrix(j, 4) = "已删除"
        MSFlexGrid1.TextMatrix(j, 5) = "已删除"
        MSFlexGrid1.TextMatrix(j, 6) = "已删除"
        MSFlexGrid1.TextMatrix(j, 7) = "已删除"
        MSFlexGrid1.TextMatrix(j, 8) = "已删除"
        MSFlexGrid1.TextMatrix(j, 9) = "已删除"
        MSFlexGrid1.TextMatrix(j, 10) = "已删除"
        MSFlexGrid1.TextMatrix(j, 11) = "已删除"
    End If
    j = 0
    TextDcolor
    Text1(1).Enabled = False
    Text1(2).Enabled = False
    Text1(3).Enabled = False
    Combo1.Enabled = False
    Text1(4).Enabled = False
    Text1(5).Enabled = False
    Text1(6).Enabled = False
    Text1(7).Enabled = False
    Text1(8).Enabled = False
    Text1(9).Enabled = False
    Text1(10).Enabled = False
    Text1(11).Enabled = False
End Sub

Private Sub Command5_Click()
    TextDcolor
    If Label1(0).BackColor = &HFFFFFF Then
        Combo1.Enabled = False
        Combo1.Visible = False
        Text1(4).Visible = True
    End If
    If Label1(1).BackColor = &HFFFFFF Then
        MSFlexGrid1.Clear
        ShowTitle
        Text1(4).Visible = True
        Combo1.Visible = False
        Text1(2).Enabled = False
        Text1(3).Enabled = False
        Text1(4).Enabled = False
        Text1(5).Enabled = False
        Text1(6).Enabled = False
        Text1(7).Enabled = False
        Text1(8).Enabled = False
        Text1(9).Enabled = False
        Text1(10).Enabled = False
        
    End If
    If Label1(2).BackColor = &HFFFFFF Then
        Text1(1).Enabled = False
        Text1(2).Enabled = False
        Text1(3).Enabled = False
        Combo1.Enabled = False
        Combo1.Visible = False
        Text1(4).Visible = True
        Text1(4).Enabled = False
        Text1(5).Enabled = False
        Text1(6).Enabled = False
        Text1(7).Enabled = False
        Text1(8).Enabled = False
        Text1(9).Enabled = False
        Text1(10).Enabled = False
        Text1(11).Enabled = False
    End If
    If Label1(3).BackColor = &HFFFFFF Then
        Text1(1).Enabled = False
        Text1(2).Enabled = False
        Text1(3).Enabled = False
        Combo1.Enabled = False
        Combo1.Visible = False
        Text1(4).Visible = True
        Text1(4).Enabled = False
        Text1(5).Enabled = False
        Text1(6).Enabled = False
        Text1(7).Enabled = False
        Text1(8).Enabled = False
        Text1(9).Enabled = False
        Text1(10).Enabled = False
        Text1(11).Enabled = False
    End If
End Sub

Private Sub Command6_Click()
    Unload frmstsi
End Sub

Private Sub Form_Load()
    Me.Caption = "明星档案->查  询"
    ShowTitle
    Label1(1).BackColor = &HFFFFFF
    TextDcolor
    Text1(4).Visible = True
    Combo1.Visible = False
    Command1.Visible = False
    Command2.Visible = True
    Command3.Visible = False
    Command4.Visible = False
    Text1(2).Enabled = False
    Text1(3).Enabled = False
    Text1(4).Enabled = False
    Text1(5).Enabled = False
    Text1(6).Enabled = False
    Text1(7).Enabled = False
    Text1(8).Enabled = False
    Text1(9).Enabled = False
    Text1(10).Enabled = False
    If Not UserName = "admin" Then
    Label1(0).Enabled = False
    Label1(2).Enabled = False
    Label1(3).Enabled = False
    End If
End Sub

Private Sub Form_Resize()
    dColor.ZOrder 1
End Sub

Private Sub TextDcolor()
    Dim txtSQL As String
    For i = 0 To 11
        Text1(i).Enabled = True
        Combo1.Enabled = True
        Text1(i).BackColor = &HE0E0E0
        Text1(i) = Label2(i).Caption
        If i = 7 Or i = 8 Then
            Text1(i).Height = 300
        End If
    Next
    Text1(4).Visible = False
    Combo1.Visible = True
    Combo1.Clear
    Combo1.AddItem Label2(4).Caption
    Combo1.BackColor = &HE0E0E0
    Combo1.ListIndex = 0
    
End Sub

Private Sub Label1_Click(Index As Integer)
    Me.Caption = "明星档案->"
    Me.Caption = Me.Caption & Trim(Label1(Index).Caption)
    Label1(0).BackColor = &HE0E0E0
    Label1(1).BackColor = &HE0E0E0
    Label1(2).BackColor = &HE0E0E0
    Label1(3).BackColor = &HE0E0E0
    Label1(Index).BackColor = &HFFFFFF
    Label2(4).Caption = "在此输入明星籍贯"
    Label2(5).Caption = "在此输入明星身高"
    Label2(6).Caption = "在此输入明星体重"
    Command5.SetFocus
    If Index = 0 Then
        TextDcolor
        Command1.Visible = True
        Command2.Visible = False
        Command3.Visible = False
        Command4.Visible = False
        Text1(4).Visible = True
        Combo1.Visible = False
    End If
    If Index = 1 Then
        Label2(4).Caption = "在此输入明星籍贯"
        Label2(5).Caption = "在此输入明星身高"
        Label2(6).Caption = "在此输入明星体重"
        TextDcolor
        Text1(4).Visible = True
        Combo1.Visible = False
        Command1.Visible = False
        Command2.Visible = True
        Command3.Visible = False
        Command4.Visible = False
        Text1(2).Enabled = False
        Text1(3).Enabled = False
        Text1(4).Enabled = False
        Text1(5).Enabled = False
        Text1(6).Enabled = False
        Text1(7).Enabled = False
        Text1(8).Enabled = False
        Text1(9).Enabled = False
        Text1(10).Enabled = False
        
    End If
    If Index = 2 Then
        TextDcolor
        Text1(0).SetFocus
        Command1.Visible = False
        Command2.Visible = False
        Command3.Visible = True
        Command4.Visible = False
        Text1(4).Visible = True
        Combo1.Visible = False
    End If
    If Index = 3 Then
        TextDcolor
        Text1(0).SetFocus
        Command1.Visible = False
        Command2.Visible = False
        Command3.Visible = False
        Command4.Visible = True
        Text1(1).Enabled = False
        Text1(2).Enabled = False
        Text1(3).Enabled = False
        Combo1.Enabled = False
        Combo1.Visible = False
        Text1(4).Enabled = False
        Text1(4).Visible = True
        Text1(5).Enabled = False
        Text1(6).Enabled = False
        Text1(7).Enabled = False
        Text1(8).Enabled = False
        Text1(9).Enabled = False
        Text1(10).Enabled = False
        Text1(11).Enabled = False
    End If
End Sub


Private Sub MSFlexGrid1_Click()
    If Label1(2).BackColor = &HFFFFFF Or Label1(3).BackColor = &HFFFFFF Then
        If MSFlexGrid1.Row <> 0 Then
            For i = 0 To 11
                Text1(i) = MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, i)
            Next
            If Label1(2).BackColor = &HFFFFFF Then
                For i = 0 To 11
                    Text1(i).BackColor = &H8000000E
                Next
            End If
            If Label1(3).BackColor = &HFFFFFF Then
                Text1(0).BackColor = &H8000000E
            End If
            Text1(7).Height = 600
            Text1(8).Height = 600
        End If
    End If
End Sub

Private Sub Text1_Change(Index As Integer)
    If Label1(2).BackColor = &HFFFFFF Or Label1(3).BackColor = &HFFFFFF Then
        If Index = 0 Then
            tSQL = "select * from starinfo_Form where starinfo_NO='" & Trim(Text1(Index)) & "'"
            Set mrc = ExecuteSQL(tSQL, MsgText)
            If mrc.EOF = False Then
                For i = 1 To 8
                    Text1(i) = mrc.Fields(i)
                Next
                Combo1.Clear
                Combo1.AddItem Text1(4)
                Combo1.ListIndex = 0
                
                If Label1(2).BackColor = &HFFFFFF Then
                For i = 1 To 8
                    Text1(i).BackColor = &H8000000E
                Next
                Combo1.BackColor = &H8000000E
                End If
                Text1(7).Height = 600
                Text1(8).Height = 600
                Command3.Enabled = True
                Command4.Enabled = True
                Exit Sub
            Else
                For i = 1 To 8
                    Text1(i) = Label2(i).Caption
                Next
                Combo1.Clear
                Combo1.AddItem Label2(4).Caption
                Combo1.ListIndex = 0
                If Label1(2).BackColor = &HFFFFFF Then
                For i = 1 To 8
                    Text1(i).BackColor = &HE0E0E0
                Next
                Combo1.BackColor = &HE0E0E0
                End If
                Text1(7).Height = 300
                Text1(8).Height = 300
                Command3.Enabled = False
                Command4.Enabled = False
            End If
            mrc.Close
        End If
    End If
End Sub

Private Sub Text1_Click(Index As Integer)
    If Index = 2 Then
        If Text1(Index) = "男" Then
            Text1(Index) = "女"
        Else
            Text1(Index) = "男"
        End If
    End If
End Sub

Private Sub Text1_GotFocus(Index As Integer)
    If Text1(Index) = Label2(Index).Caption Then
        Text1(Index).BackColor = &H8000000E
        Text1(Index) = ""
        If Index = 7 Or Index = 8 Then
            Text1(Index).Height = 600
        End If
    End If
    Text1(Index).SelStart = 0
    Text1(Index).SelLength = Len(Text1(Index))
End Sub

Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
    EnterToTab KeyCode
End Sub

Private Sub Text1_LostFocus(Index As Integer)
    If Text1(Index) = "" Then
        Text1(Index).BackColor = &HE0E0E0
        Text1(Index) = Label2(Index).Caption
        If Index = 7 Or Index = 8 Then
            Text1(Index).Height = 300
        End If
    End If
End Sub
Private Sub ShowTitle()
    Dim i As Integer
    
    With MSFlexGrid1
        .Cols = 12
        .TextMatrix(0, 0) = "编号"
        .TextMatrix(0, 1) = "姓名"
        .TextMatrix(0, 2) = "性别"
        .TextMatrix(0, 3) = "生日"
        .TextMatrix(0, 4) = "籍贯"
        .TextMatrix(0, 5) = "身高"
        .TextMatrix(0, 6) = "体重"
        .TextMatrix(0, 7) = "特长"
        .TextMatrix(0, 8) = "嗜好"
        .TextMatrix(0, 9) = "星座"
        .TextMatrix(0, 10) = "血型"
        .TextMatrix(0, 11) = "地域"
        
        
        .ColWidth(0) = 800
        .ColWidth(1) = 1500
        .ColWidth(2) = 500
        .ColWidth(3) = 1500
        .ColWidth(4) = 1800
        .ColWidth(5) = 1000
        .ColWidth(6) = 1000
        .ColWidth(7) = 6000
        .ColWidth(8) = 6000
        .ColWidth(9) = 1200
        .ColWidth(10) = 800
        .ColWidth(11) = 1500
        
    
        .Rows = 1
    End With
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -