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

📄 edit.frm

📁 独一无二的数据库编程例程
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Edit 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "编辑"
   ClientHeight    =   5070
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5430
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5070
   ScaleWidth      =   5430
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin MSComDlg.CommonDialog CommonDialog 
      Left            =   840
      Top             =   4320
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      Filter          =   "*.bmp|*.bmp"
      InitDir         =   ".\newface\"
   End
   Begin VB.Frame Frame 
      Caption         =   "详细资料:"
      Height          =   4935
      Left            =   120
      TabIndex        =   1
      Top             =   0
      Width           =   5175
      Begin VB.PictureBox HeadPicture 
         AutoSize        =   -1  'True
         Height          =   540
         Left            =   240
         MouseIcon       =   "Edit.frx":0000
         MousePointer    =   99  'Custom
         Picture         =   "Edit.frx":0152
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   0
         Top             =   360
         Width           =   540
      End
      Begin VB.CommandButton Command1 
         Caption         =   "确定"
         Height          =   375
         Left            =   2520
         TabIndex        =   26
         Top             =   4320
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         DataField       =   "姓名"
         DataSource      =   "Data"
         Height          =   270
         Index           =   0
         Left            =   1560
         TabIndex        =   3
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         DataField       =   "性别"
         DataSource      =   "Data"
         Height          =   270
         Index           =   2
         Left            =   1560
         TabIndex        =   7
         Top             =   720
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         DataField       =   "昵称"
         DataSource      =   "Data"
         Height          =   270
         Index           =   3
         Left            =   3720
         TabIndex        =   9
         Top             =   720
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         DataField       =   "QQ号码"
         DataSource      =   "Data"
         Height          =   270
         Index           =   1
         Left            =   3720
         TabIndex        =   5
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         DataField       =   "E-mail地址"
         DataSource      =   "Data"
         Height          =   270
         Index           =   4
         Left            =   840
         TabIndex        =   13
         Top             =   1440
         Width           =   4095
      End
      Begin VB.TextBox Text1 
         DataField       =   "家庭住址"
         DataSource      =   "Data"
         Height          =   270
         Index           =   5
         Left            =   1200
         TabIndex        =   15
         Top             =   2640
         Width           =   3735
      End
      Begin VB.TextBox Text1 
         DataField       =   "工作单位"
         DataSource      =   "Data"
         Height          =   270
         Index           =   6
         Left            =   1200
         TabIndex        =   17
         Top             =   3000
         Width           =   3735
      End
      Begin VB.TextBox Text1 
         DataField       =   "住宅电话"
         DataSource      =   "Data"
         Height          =   270
         Index           =   7
         Left            =   1200
         TabIndex        =   19
         Top             =   3480
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         DataField       =   "单位电话"
         DataSource      =   "Data"
         Height          =   270
         Index           =   8
         Left            =   3720
         TabIndex        =   21
         Top             =   3480
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         DataField       =   "BP机"
         DataSource      =   "Data"
         Height          =   270
         Index           =   9
         Left            =   1200
         TabIndex        =   23
         Top             =   3840
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         DataField       =   "手机"
         DataSource      =   "Data"
         Height          =   270
         Index           =   10
         Left            =   3720
         TabIndex        =   25
         Top             =   3840
         Width           =   1215
      End
      Begin VB.TextBox Text1 
         DataField       =   "头像"
         DataSource      =   "Data"
         Height          =   270
         Index           =   11
         Left            =   360
         TabIndex        =   28
         Text            =   "1"
         Top             =   480
         Width           =   255
      End
      Begin VB.CommandButton Command2 
         Caption         =   "取消"
         Height          =   375
         Left            =   3840
         TabIndex        =   27
         Top             =   4320
         Width           =   1095
      End
      Begin MSComCtl2.DTPicker DTPicker 
         DataField       =   "生日"
         DataSource      =   "Data"
         Height          =   255
         Left            =   840
         TabIndex        =   11
         Top             =   1080
         Width           =   4095
         _ExtentX        =   7223
         _ExtentY        =   450
         _Version        =   393216
         CheckBox        =   -1  'True
         CustomFormat    =   "yyyy & ""年"" & mm & ""月"" & dd & ""日"""
         Format          =   24510464
         CurrentDate     =   37422
         MaxDate         =   2958462
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "姓名:"
         Height          =   180
         Left            =   960
         TabIndex        =   2
         Top             =   420
         Width           =   540
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "性别:"
         Height          =   180
         Left            =   960
         TabIndex        =   6
         Top             =   780
         Width           =   540
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "昵称:"
         Height          =   180
         Left            =   3120
         TabIndex        =   8
         Top             =   780
         Width           =   540
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "生日:"
         Height          =   180
         Left            =   240
         TabIndex        =   10
         Top             =   1140
         Width           =   540
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "QQ号:"
         Height          =   180
         Left            =   3120
         TabIndex        =   4
         Top             =   420
         Width           =   540
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         Caption         =   "Email:"
         Height          =   180
         Left            =   240
         TabIndex        =   12
         Top             =   1500
         Width           =   630
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         Caption         =   "家庭地址:"
         Height          =   180
         Left            =   240
         TabIndex        =   14
         Top             =   2700
         Width           =   900
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "工作单位:"
         Height          =   180
         Left            =   240
         TabIndex        =   16
         Top             =   3060
         Width           =   900
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         Caption         =   "小燕子专用版"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   36
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000001&
         Height          =   720
         Left            =   360
         TabIndex        =   29
         Top             =   1800
         Width           =   4320
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "住宅电话:"
         Height          =   180
         Left            =   240
         TabIndex        =   18
         Top             =   3540
         Width           =   900
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "单位电话:"
         Height          =   180
         Left            =   2760
         TabIndex        =   20
         Top             =   3540
         Width           =   900
      End
      Begin VB.Label Label12 
         AutoSize        =   -1  'True
         Caption         =   "BP    机:"
         Height          =   180
         Left            =   240
         TabIndex        =   22
         Top             =   3900
         Width           =   900
      End
      Begin VB.Label Label13 
         AutoSize        =   -1  'True
         Caption         =   "手    机:"
         Height          =   180
         Left            =   2760
         TabIndex        =   24
         Top             =   3900
         Width           =   900
      End
   End
End
Attribute VB_Name = "Edit"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
On Error Resume Next
If Text1(0).Text <> "" Then
  Dim l As Integer
  l = Asc(UCase(Left(GetChineseSpell(Text1(0).Text), 1)))
  If l < Asc("A") Or l > Asc("Z") Or Left(Text1(0).Text, 1) = " " Then
  MsgBox "名字第一个不能是符号或数字!"
  Exit Sub
  Else
    If ADD_NEW Then
      MainForm.Data.Recordset.MoveLast
      MainForm.Data.Recordset.MoveNext
      MainForm.Data.Recordset.AddNew
    Else
      If InStr(MainForm.TreeView.SelectedItem.FullPath, "★") <> 0 Then
        MainForm.TreeView.Nodes.Remove (MainForm.TreeView.SelectedItem.Index)
      End If
    End If
   End If
Else
Exit Sub
End If
  Dim PersonName As String
  PersonName = Text1(0).Text
  xindex = Asc(UCase(Left(GetChineseSpell(PersonName), 1))) - 64
  Dim Person As Node
  Set Person = MainForm.TreeView.Nodes.Add(xindex, tvwChild, , PersonName, Val(Text1(11).Text))

  For i = 0 To 11
  MainForm.Text1(i).Text = Text1(i).Text
  Next i
  MainForm.DTPicker.Value = DTPicker.Value
  MainForm.Data.UpdateRecord
  MainForm.Data.Refresh
  MainForm.HeadPicture.Picture = LoadPicture()
  MainForm.HeadPicture.Picture = LoadPicture(App.Path & "\newface\" & Right("000" & MainForm.Text1(11).Text, 3) & ".bmp")
Unload Me
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Load()
If Not ADD_NEW Then
  For i = 0 To 11
    Text1(i).Text = MainForm.Text1(i).Text
  Next i
  DTPicker.Value = MainForm.DTPicker.Value
HeadPicture.Picture = LoadPicture()
HeadPicture.Picture = LoadPicture(App.Path & "\newface\" & Right("000" & Text1(11).Text, 3) & ".bmp")
End If
End Sub

Private Sub HeadPicture_Click()
On Error GoTo ErrHandler
CommonDialog.ShowOpen
s = CommonDialog.FileName
Do While InStr(s, "\") > 0
s = Right(s, Len(s) - InStr(s, "\"))
t = t & Left(s, InStr(s, "\"))
Loop
If InStr(s, "\") = 0 And Val(Left(s, 3)) >= 0 And Val(Left(s, 3)) <= 84 Then
HeadPicture.Picture = LoadPicture(s)
Text1(11).Text = Str(Val(Left(s, 3)))
Else
MsgBox "请选择" & s & "下的预定图片!"
End If
ErrHandler:
Err.Clear
End Sub

⌨️ 快捷键说明

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