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

📄 form1.frm

📁 个人理财的VB代码
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Left            =   600
         OleObjectBlob   =   "Form1.frx":0932
         TabIndex        =   16
         Top             =   330
         Width           =   975
      End
      Begin VB.PictureBox Picture3 
         Height          =   2295
         Left            =   2040
         ScaleHeight     =   2235
         ScaleWidth      =   1755
         TabIndex        =   7
         Top             =   600
         Width           =   1815
         Begin VB.Label Label9 
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Label9"
            DataField       =   "其它2"
            DataSource      =   "Data2"
            ForeColor       =   &H80000008&
            Height          =   255
            Left            =   600
            TabIndex        =   25
            Top             =   1680
            Width           =   855
         End
         Begin VB.Label Label8 
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Label8"
            DataField       =   "投资"
            DataSource      =   "Data2"
            ForeColor       =   &H80000008&
            Height          =   255
            Left            =   600
            TabIndex        =   24
            Top             =   1320
            Width           =   855
         End
         Begin VB.Label Label7 
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Label7"
            DataField       =   "娱乐"
            DataSource      =   "Data2"
            ForeColor       =   &H80000008&
            Height          =   255
            Left            =   600
            TabIndex        =   23
            Top             =   960
            Width           =   855
         End
         Begin VB.Label Label6 
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Label6"
            DataField       =   "学习"
            DataSource      =   "Data2"
            ForeColor       =   &H80000008&
            Height          =   255
            Left            =   600
            TabIndex        =   22
            Top             =   600
            Width           =   855
         End
         Begin VB.Label Label5 
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Label5"
            DataField       =   "生活"
            DataSource      =   "Data2"
            ForeColor       =   &H80000008&
            Height          =   255
            Left            =   600
            TabIndex        =   21
            Top             =   240
            Width           =   855
         End
         Begin VB.Label Label1 
            Caption         =   "其它"
            Height          =   255
            Index           =   11
            Left            =   120
            TabIndex        =   15
            Top             =   1680
            Width           =   615
         End
         Begin VB.Label Label1 
            Caption         =   "投资"
            Height          =   255
            Index           =   10
            Left            =   120
            TabIndex        =   14
            Top             =   1320
            Width           =   615
         End
         Begin VB.Label Label1 
            Caption         =   "娱乐"
            Height          =   255
            Index           =   9
            Left            =   120
            TabIndex        =   13
            Top             =   960
            Width           =   615
         End
         Begin VB.Label Label1 
            Caption         =   "学习"
            Height          =   255
            Index           =   8
            Left            =   120
            TabIndex        =   12
            Top             =   600
            Width           =   615
         End
         Begin VB.Label Label1 
            Caption         =   "生活"
            Height          =   255
            Index           =   7
            Left            =   120
            TabIndex        =   11
            Top             =   240
            Width           =   615
         End
      End
      Begin VB.PictureBox Picture2 
         Height          =   2295
         Left            =   120
         ScaleHeight     =   2235
         ScaleWidth      =   1635
         TabIndex        =   6
         Top             =   600
         Width           =   1695
         Begin VB.Label Label4 
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Label4"
            DataField       =   "其它"
            DataSource      =   "Data2"
            ForeColor       =   &H80000008&
            Height          =   375
            Left            =   600
            TabIndex        =   20
            Top             =   1560
            Width           =   855
         End
         Begin VB.Label Label3 
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Label3"
            DataField       =   "经商"
            DataSource      =   "Data2"
            ForeColor       =   &H80000008&
            Height          =   375
            Left            =   600
            TabIndex        =   19
            Top             =   960
            Width           =   855
         End
         Begin VB.Label Label2 
            Appearance      =   0  'Flat
            BackColor       =   &H80000005&
            BorderStyle     =   1  'Fixed Single
            Caption         =   "Label2"
            DataField       =   "工资"
            DataSource      =   "Data2"
            ForeColor       =   &H80000008&
            Height          =   375
            Left            =   600
            TabIndex        =   18
            Top             =   360
            Width           =   855
         End
         Begin VB.Label Label1 
            Caption         =   "其它"
            Height          =   255
            Index           =   6
            Left            =   120
            TabIndex        =   10
            Top             =   1680
            Width           =   615
         End
         Begin VB.Label Label1 
            Caption         =   "工资"
            Height          =   255
            Index           =   5
            Left            =   120
            TabIndex        =   9
            Top             =   480
            Width           =   615
         End
         Begin VB.Label Label1 
            Caption         =   "经商"
            Height          =   255
            Index           =   4
            Left            =   120
            TabIndex        =   8
            Top             =   1080
            Width           =   615
         End
      End
   End
   Begin ACTIVESKINLibCtl.Skin Skin1 
      Left            =   0
      OleObjectBlob   =   "Form1.frx":0994
      Top             =   0
   End
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   0
      Top             =   600
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.Menu jilu 
      Caption         =   "记录(&F)"
      Begin VB.Menu j1 
         Caption         =   "新增收支"
         Shortcut        =   ^D
      End
      Begin VB.Menu j2 
         Caption         =   "修改收支"
         Shortcut        =   ^U
      End
      Begin VB.Menu j3 
         Caption         =   "删除记录"
         Shortcut        =   ^R
      End
      Begin VB.Menu a 
         Caption         =   "_________________"
         Enabled         =   0   'False
      End
      Begin VB.Menu j4 
         Caption         =   "上一记录"
         Shortcut        =   {F11}
      End
      Begin VB.Menu j5 
         Caption         =   "下一记录"
         Shortcut        =   {F12}
      End
      Begin VB.Menu a1 
         Caption         =   "_________________"
         Enabled         =   0   'False
      End
      Begin VB.Menu j6 
         Caption         =   "退出"
         Shortcut        =   ^X
      End
   End
   Begin VB.Menu sji 
      Caption         =   "数据(&E)"
      Begin VB.Menu S1 
         Caption         =   "导出数据"
      End
      Begin VB.Menu S2 
         Caption         =   "导入数据"
      End
   End
   Begin VB.Menu ban 
      Caption         =   "帮助(&H)"
      Begin VB.Menu b1 
         Caption         =   "帮助"
         Shortcut        =   ^C
      End
      Begin VB.Menu b2 
         Caption         =   "关于"
         Shortcut        =   ^Z
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'我非常想同你交个朋友不知你可否乐意,我现在想学VC++,你有什么
,源程序寄份给我好吗?

Option Explicit
Private FormOldWidth As Long
    '保存窗体的原始宽度
Private FormOldHeight As Long
    '保存窗体的原始高度

'在调用ResizeForm前先调用本函数
Public Sub ResizeInit(FormName As Form)
   Dim Obj As Control
   FormOldWidth = FormName.ScaleWidth
   FormOldHeight = FormName.ScaleHeight
   On Error Resume Next
   For Each Obj In FormName
     Obj.Tag = Obj.Left & " " & Obj.Top & " " _
           & Obj.Width & " " & Obj.Height & " "
   Next Obj
   On Error GoTo 0
End Sub

'按比例改变表单内各元件的大小,在调用ReSizeForm前先调用ReSizeInit函数
Public Sub ResizeForm(FormName As Form)
   Dim Pos(4) As Double
   Dim i As Long, TempPos As Long, StartPos As Long
   Dim Obj As Control
   Dim ScaleX As Double, ScaleY As Double

   ScaleX = FormName.ScaleWidth / FormOldWidth
   '保存窗体宽度缩放比例
   ScaleY = FormName.ScaleHeight / FormOldHeight
   '保存窗体高度缩放比例
   On Error Resume Next
   For Each Obj In FormName
     StartPos = 1
     For i = 0 To 4
      '读取控件的原始位置与大小

       TempPos = InStr(StartPos, Obj.Tag, " ", vbTextCompare)
       If TempPos > 0 Then
         Pos(i) = Mid(Obj.Tag, StartPos, TempPos - StartPos)
         StartPos = TempPos + 1
       Else
         Pos(i) = 0
       End If
       '根据控件的原始位置及窗体改变大小的比例对控件重新定位与改变大小
       Obj.Move Pos(0) * ScaleX, Pos(1) * ScaleY, _
                Pos(2) * ScaleX, Pos(3) * ScaleY
     Next i
   Next Obj
   On Error GoTo 0
End Sub


Private Sub b2_Click()
Form3.Show '显示关于窗体
End Sub

Private Sub Command1_Click()
'-----------------------------------------------------------------------------
'显示第二窗体,即记录窗体
Form2.Show
'-----------------------------------------------------------------------------
End Sub

Private Sub Command2_Click()
Dim result
  result = MsgBox("确定删除记录吗?不可恢复", vbQuestion + vbYesNo, "个人理财")
  If result = vbYes Then
  Command8_Click
  End If
End Sub

Private Sub Command5_Click()
Command4.Enabled = True '
If Data1.Recordset.EOF = False Then '如果记录不是最后一条然后
Data1.Recordset.MoveNext '移到下一条记录
Else
  Command5.Enabled = False '如果是后记录哪按钮为不可操作
  End If

End Sub

Private Sub Command6_Click()
End '退出程序
End Sub

Private Sub Command7_Click()
Form5.Show
'------------------------------------------------------------------------------
Form5!MSFlexGrid1.Clear
    Form5!MSFlexGrid1.Cols = 4
    Form5!MSFlexGrid1.FixedCols = 0
    Form5!MSFlexGrid1.FixedRows = 1
    
    Form5!MSFlexGrid1.ColWidth(0) = Form5!MSFlexGrid1.Width / 6
    Form5!MSFlexGrid1.ColWidth(1) = Form5!MSFlexGrid1.Width / 6
    Form5!MSFlexGrid1.ColWidth(2) = Form5!MSFlexGrid1.Width / 6
    Form5!MSFlexGrid1.ColWidth(3) = Form5!MSFlexGrid1.Width / 1
    Form5!MSFlexGrid1.TextMatrix(0, 0) = "日期"
    Form5!MSFlexGrid1.TextMatrix(0, 1) = "钱额"
    Form5!MSFlexGrid1.TextMatrix(0, 2) = "类型"
    Form5!MSFlexGrid1.TextMatrix(0, 3) = "说明"
    Form5!MSFlexGrid1.Rows = 2

⌨️ 快捷键说明

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