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

📄 frmsavefile.frm

📁 VB代码生成器
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSaveFile 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "选择生成目标"
   ClientHeight    =   4575
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6135
   Icon            =   "frmSaveFile.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4575
   ScaleWidth      =   6135
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.Frame Frame1 
      Caption         =   "代码生成配置"
      Height          =   2775
      Left            =   240
      TabIndex        =   3
      Top             =   1080
      Width           =   5655
      Begin VB.PictureBox Picture1 
         Appearance      =   0  'Flat
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   2295
         Left            =   120
         ScaleHeight     =   2295
         ScaleWidth      =   5175
         TabIndex        =   4
         Top             =   360
         Width           =   5175
         Begin VB.CommandButton cmdOpenFolder 
            Caption         =   "..."
            Height          =   285
            Left            =   4440
            TabIndex        =   11
            Top             =   1320
            Width           =   375
         End
         Begin VB.OptionButton optVBVC 
            Caption         =   "VB代码"
            Height          =   495
            Index           =   0
            Left            =   120
            TabIndex        =   9
            Top             =   -120
            Width           =   975
         End
         Begin VB.OptionButton optVBVC 
            Caption         =   "VC代码"
            Height          =   495
            Index           =   1
            Left            =   1140
            TabIndex        =   8
            Top             =   -120
            Width           =   975
         End
         Begin VB.OptionButton optVBVC 
            Caption         =   "两者"
            Height          =   495
            Index           =   2
            Left            =   2160
            TabIndex        =   7
            Top             =   -120
            Width           =   975
         End
         Begin VB.CheckBox chkCreateLib 
            Caption         =   "生成数据库访问层动态连接库"
            Height          =   255
            Left            =   120
            TabIndex        =   6
            Top             =   360
            Width           =   4335
         End
         Begin VB.CheckBox chkCreateLibResource 
            Caption         =   "生成数据库访问层动态连接库源程序 (以 zip 格式压缩)"
            Height          =   195
            Left            =   120
            TabIndex        =   5
            Top             =   720
            Width           =   5055
         End
         Begin VB.TextBox txtOpenFolder 
            Height          =   285
            Left            =   120
            TabIndex        =   12
            Top             =   1320
            Width           =   4335
         End
         Begin VB.TextBox txtVbpFile 
            Height          =   285
            Left            =   120
            TabIndex        =   10
            Top             =   1920
            Width           =   4695
         End
         Begin VB.Label lblFileName 
            BackColor       =   &H80000009&
            BackStyle       =   0  'Transparent
            Caption         =   "指定生成代码文件夹(&F):"
            Height          =   195
            Index           =   0
            Left            =   120
            TabIndex        =   14
            Top             =   1080
            Width           =   1875
         End
         Begin VB.Label lblFileName 
            BackColor       =   &H80000009&
            BackStyle       =   0  'Transparent
            Caption         =   "工程名(&P):"
            Height          =   195
            Index           =   1
            Left            =   120
            TabIndex        =   13
            Top             =   1680
            Width           =   1155
         End
      End
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消(&C)"
      Height          =   375
      Left            =   4800
      TabIndex        =   1
      Top             =   3960
      Width           =   1095
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定(&O)"
      Default         =   -1  'True
      Height          =   375
      Left            =   3600
      TabIndex        =   0
      Top             =   3960
      Width           =   1095
   End
   Begin VB.Label Label1 
      Caption         =   "输入生成代码类别并且指定保存文件的名称及路径。"
      Height          =   195
      Left            =   1080
      TabIndex        =   2
      Top             =   360
      Width           =   4140
   End
   Begin VB.Image Image1 
      Height          =   615
      Left            =   240
      Picture         =   "frmSaveFile.frx":0CCA
      Stretch         =   -1  'True
      Top             =   120
      Width           =   615
   End
End
Attribute VB_Name = "frmSaveFile"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**********************************************************************
'**  功能描述: 代码生成器保存文件
'**
'**  作    者: 陈顺球(LionCSQ)
'**  创建时间: 2005 年 09 月 08 日
'**-------------------------------------------------------------------
'**
'**  改进人员: 寻百安(XunBaian)
'**  改进日期: 2005 年 09 月 15 日

'**  改进描述:
'**********************************************************************

Option Explicit

Public Event CreateCodeFile(ByVal vlngCodeType As Long, ByVal vstrFilePath As String, ByVal vstrFileName As String, ByVal vblnCreateLib As Boolean, ByVal vblnCreateLibResource As Boolean)
Public Event ReSet()

Private WithEvents mfrmLogin As frmLogin
Attribute mfrmLogin.VB_VarHelpID = -1
Private mintSucceeded As Integer

Private mlngCodeType As Long
Private mblnCreateLib As Boolean, mblnCreateLibResource As Boolean

Private Sub chkCreateLib_Click()
   mblnCreateLib = CBool(chkCreateLib.Value)
   chkCreateLibResource.Enabled = mblnCreateLib
End Sub

Private Sub chkCreateLibResource_Click()
   mblnCreateLibResource = CBool(chkCreateLibResource.Value)
End Sub

Private Sub cmdCancel_Click()
   Me.Hide
End Sub

Private Sub cmdOK_Click()
   Dim strFilePath As String
   Dim strFileName As String
   
   strFilePath = txtOpenFolder.Text
   strFilePath = IIf(Right(strFilePath, 1) = "\", strFilePath, strFilePath & "\")
   
   strFileName = txtVbpFile.Text
   If Len(Trim(strFileName)) = 0 Then
      strFileName = "NewProject"
   End If
   
   RaiseEvent CreateCodeFile(mlngCodeType, strFilePath, strFileName, mblnCreateLib, mblnCreateLibResource)
   
   Me.Hide
End Sub

Private Sub cmdOpenFolder_Click()
   Dim strFilePath As String
   
   strFilePath = GetFolder(Me, IIf(txtOpenFolder.Text = "", App.Path, txtOpenFolder.Text))
   
   If Len(strFilePath) = 0 Then
      strFilePath = App.Path
   End If
   
   strFilePath = IIf(Right(strFilePath, 1) = "\", strFilePath, strFilePath & "\")
   
   txtOpenFolder.Text = strFilePath
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
   If KeyCode = vbKeyQ And _
      (Shift And vbCtrlMask) > 0 And _
      (Shift And vbAltMask) > 0 Then
      
      Set mfrmLogin = New frmLogin
      mintSucceeded = 0
      mfrmLogin.LoginOnStart = False
      mfrmLogin.Show vbModal
      chkCreateLibResource.Visible = CBool(mintSucceeded)
      Set mfrmLogin = Nothing
      If mintSucceeded = -1 Then
         RaiseEvent ReSet
         Unload Me
      End If
   End If
End Sub

Private Sub Form_Load()
   chkCreateLibResource.Enabled = False
   chkCreateLibResource.Visible = False
   chkCreateLib.Value = Checked
   
   optVBVC(0).Value = True
   txtOpenFolder.Text = "C:\"
   txtVbpFile = "NewProject"
   Me.KeyPreview = True
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
   If UnloadMode = vbFormControlMenu Then Cancel = -1
   Me.Hide
End Sub

Private Sub mfrmLogin_LoginSucceeded(ByVal vintSucceeded As Integer)
   mintSucceeded = vintSucceeded
End Sub

Private Sub optVBVC_Click(Index As Integer)
   mlngCodeType = Index
End Sub

Private Sub txtOpenFolder_GotFocus()
   txtOpenFolder.SelStart = 0
   txtOpenFolder.SelLength = Len(txtOpenFolder.Text)
End Sub

Private Sub txtVbpFile_GotFocus()
   txtVbpFile.SelStart = 0
   txtVbpFile.SelLength = Len(txtVbpFile.Text)
End Sub

⌨️ 快捷键说明

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