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

📄 frmdataview.frm

📁 vc++的部分比较经典的源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmDataView 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Data View"
   ClientHeight    =   6720
   ClientLeft      =   45
   ClientTop       =   285
   ClientWidth     =   10440
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6720
   ScaleWidth      =   10440
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command3 
      BackColor       =   &H00E0E0E0&
      Caption         =   "Edit"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4035
      Style           =   1  'Graphical
      TabIndex        =   9
      Top             =   6330
      Width           =   1170
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00E0E0E0&
      Caption         =   "Save"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   5745
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   6330
      Width           =   1170
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00E0E0E0&
      Caption         =   "Close"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   8940
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   6360
      Width           =   1170
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      Height          =   285
      Index           =   0
      Left            =   3360
      TabIndex        =   5
      Text            =   "Text1"
      Top             =   435
      Visible         =   0   'False
      Width           =   6855
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "# After Editing You should make new keyword for updating the keyword database"
      ForeColor       =   &H00FFFFFF&
      Height          =   390
      Left            =   165
      TabIndex        =   10
      Top             =   6300
      Width           =   3165
   End
   Begin VB.Shape Shape1 
      BackColor       =   &H00808080&
      BackStyle       =   1  'Opaque
      Height          =   435
      Left            =   -105
      Top             =   6270
      Width           =   10800
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   ":"
      Height          =   195
      Index           =   0
      Left            =   3165
      TabIndex        =   6
      Top             =   450
      Visible         =   0   'False
      Width           =   45
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      Caption         =   "Label1"
      Height          =   270
      Index           =   0
      Left            =   360
      TabIndex        =   4
      Top             =   450
      Visible         =   0   'False
      Width           =   2670
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "S"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   21.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFC0C0&
      Height          =   495
      Left            =   9420
      TabIndex        =   1
      Top             =   75
      Width           =   240
   End
   Begin VB.Line Line4 
      BorderColor     =   &H00FF8080&
      X1              =   8355
      X2              =   10395
      Y1              =   105
      Y2              =   105
   End
   Begin VB.Line Line5 
      BorderColor     =   &H00FF0000&
      BorderWidth     =   2
      X1              =   8325
      X2              =   10365
      Y1              =   165
      Y2              =   165
   End
   Begin VB.Line Line6 
      BorderColor     =   &H00C00000&
      BorderWidth     =   3
      X1              =   8310
      X2              =   10350
      Y1              =   210
      Y2              =   210
   End
   Begin VB.Label Label9 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Extensive "
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C0FFFF&
      Height          =   345
      Left            =   7080
      TabIndex        =   2
      Top             =   -15
      Width           =   1275
   End
   Begin VB.Label Label10 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Label10"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   285
      Left            =   330
      TabIndex        =   0
      Top             =   120
      Width           =   900
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "data base    earch"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   15.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFC0&
      Height          =   345
      Left            =   8115
      TabIndex        =   3
      Top             =   195
      Width           =   2265
   End
   Begin VB.Shape Shape3 
      BackColor       =   &H00808080&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H00404040&
      Height          =   735
      Left            =   -420
      Top             =   -150
      Width           =   12240
   End
End
Attribute VB_Name = "FrmDataView"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
    Dim db As Database
    Dim rs As Recordset

Private Sub Command1_Click()
Unload Me
End Sub

Private Sub Command2_Click()
Dim i As Integer
rs.MoveFirst
rs.Move RecordNo - 1
rs.Edit

For i = 0 To rs.Fields.Count - 1
    rs(i) = Text1(i + 1)
    Text1(i + 1).Locked = True
Next
rs.Update
Command2.Enabled = False
Command3.Enabled = True
End Sub

Private Sub Command3_Click()
Dim i As Integer
For i = 1 To rs.Fields.Count
    Text1(i).Locked = False
Next
Command3.Enabled = False
Command2.Enabled = True
End Sub

Private Sub Form_Load()
On Error Resume Next
Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
Command2.Enabled = False
Dim VSpace As Integer
    Label10.Caption = "Tabel : " & TableName & "; Record No. " & RecordNo
    Dim Str1 As String
    Dim Fec As Integer
    Str1 = GetSetting("DataSearch", "Data", "Path")
    If Str1 = "" Then
        MsgBox "Database Not found"
        Exit Sub
    End If
    Set db = OpenDatabase(Str1)
    Set rs = db.OpenRecordset(TableName)
    rs.MoveFirst
    rs.Move RecordNo - 1
    Fec = rs.Fields.Count
    Dim i As Integer
    VSpace = 350
    For i = 1 To Fec
        Load Label1(i)
        Label1(i).Top = Label1(i - 1).Top + VSpace
        Label1(i).Caption = rs.Fields(i - 1).Name
        Label1(i).Visible = True
        Load Label2(i)
        Label2(i).Top = Label2(i - 1).Top + VSpace
        Label2(i).Visible = True
        Load Text1(i)
        Text1(i).Top = Text1(i - 1).Top + VSpace
        If rs(i - 1) <> vbNullString Then
            Text1(i).Text = rs(i - 1)
        Else
            Text1(i).Text = ""
        End If
        Text1(i).Visible = True
        Text1(i).Locked = True
    Next
End Sub

⌨️ 快捷键说明

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