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

📄 frmd.frm

📁 本人写的一个垃圾代码,主要是实现简单的打印功能
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Caption         =   "打   印"
         ButtonPicture   =   "frmD.frx":0000
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         MouseIcon       =   "frmD.frx":077A
      End
      Begin TbMenu.VsNetBut cmdDel 
         Height          =   495
         Left            =   1800
         TabIndex        =   37
         Top             =   6360
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   873
         BackColor       =   16761024
         Caption         =   "清除窗体"
         ButtonPicture   =   "frmD.frx":1454
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         MouseIcon       =   "frmD.frx":1BCE
      End
      Begin VB.Label Label24 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "房屋建设符合村镇规划要求,难予建设。"
         BeginProperty Font 
            Name            =   "黑体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   240
         TabIndex        =   31
         Top             =   3960
         Width           =   3780
      End
      Begin VB.Label Label23 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "号"
         BeginProperty Font 
            Name            =   "Microsoft Sans Serif"
            Size            =   11.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Left            =   5040
         TabIndex        =   30
         Top             =   2115
         Width           =   225
      End
      Begin VB.Label Label22 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "日    期"
         BeginProperty Font 
            Name            =   "黑体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   2520
         TabIndex        =   9
         Top             =   5880
         Width           =   840
      End
      Begin VB.Label Label21 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "发证机关"
         BeginProperty Font 
            Name            =   "黑体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   2520
         TabIndex        =   8
         Top             =   5400
         Width           =   840
      End
      Begin VB.Label Label20 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "特发此证"
         BeginProperty Font 
            Name            =   "黑体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   720
         TabIndex        =   7
         Top             =   4680
         Width           =   840
      End
      Begin VB.Label Label15 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "府第13号令)第十五条、第十六条规定,经审定,本"
         BeginProperty Font 
            Name            =   "黑体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   240
         TabIndex        =   6
         Top             =   3480
         Width           =   4725
      End
      Begin VB.Label Label14 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "根据《江西省村镇规划建设管理暂行办法》(省政"
         BeginProperty Font 
            Name            =   "黑体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   720
         TabIndex        =   5
         Top             =   3000
         Width           =   4515
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "江  西  省"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   18
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Left            =   1800
         TabIndex        =   3
         Top             =   600
         Width           =   1905
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "村镇房屋建设许可证"
         BeginProperty Font 
            Name            =   "黑体"
            Size            =   18
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Left            =   1320
         TabIndex        =   2
         Top             =   1320
         Width           =   3240
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "编号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   11.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   225
         Left            =   1680
         TabIndex        =   1
         Top             =   2160
         Width           =   450
      End
   End
End
Attribute VB_Name = "frmD"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub cmdDel_Click()
 Call ClearFrm(Me)
End Sub

Private Sub cmdPrint_Click()
  If MsgBox("确定打印吗?", vbQuestion + vbYesNo, "问题") = vbYes Then
    TextPrint frmD
  End If
End Sub

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub



Private Sub Form_Resize()

  Static iLeft1, iLeft2, iTop1, iTop2
  Static ifrmWidth, ifrmHeight

  Debug.Print iLeft1, iLeft2, iTop1, iTop2
  Debug.Print ifrmWidth, ifrmHeight
  If Not (ifrmWidth = 0 Or ifrmHeight = 0) Then
  Picture1.Left = iLeft1 + (Me.Width - ifrmWidth) / 4
  Picture1.Top = iTop1 + (Me.Height - ifrmHeight) / 2
  Picture2.Left = iLeft2 + (Me.Width - ifrmWidth) / 2
  Picture2.Top = iTop2 + (Me.Height - ifrmHeight) / 2
  End If
  iLeft1 = Picture1.Left
  iLeft2 = Picture2.Left
  
  iTop1 = Picture1.Top
  iTop2 = Picture2.Top
  
  ifrmWidth = Me.Width
  ifrmHeight = Me.Height
End Sub

Private Sub txtFrmD_DblClick(Index As Integer)
Load frmCoord
  frmCoord.ShowFontSetting "txtFrmD" & Index, Me.Name
  frmCoord.Show 1
End Sub
Private Sub LoadDataD(ByVal strKey As String)
   Dim strSQL As String
   Dim rst As ADODB.Recordset
    On Error GoTo errLink
   
   If strKey = "" Then Exit Sub
   
   Set rst = New ADODB.Recordset
   
   
   strSQL = "select * from 基本情况 where 编号='" & strKey & "'"
   rst.Open strSQL, myDB
   If Not rst.EOF Then
      txtFrmD(0) = "" & rst("编号前缀")
      txtFrmD(2) = "" & Year(rst("日期")) & "年" & Month(rst("日期")) & "月" & Day(rst("日期")) & "日"
      txtFrmD(3) = "" & rst("申请人")
      txtFrmD(4) = "" & rst("项目名称")
      txtFrmD(5) = "" & rst("建设位置")
      txtFrmD(6) = "" & Up(rst("建筑规模")) & "平方米"
      txtFrmD(7) = "" & rst("房屋层数") & "层"
      txtFrmD(8) = "" & rst("结构")
   Else
      MsgBox "该项目不存在,请仔细核对!", vbInformation, "提示"
   End If
   rst.Close
   Set rst = Nothing
   Exit Sub
errLink:
    MsgBox err.Description, vbOKOnly + vbExclamation, "提示"
   
End Sub

Private Sub txtFrmD_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
     If Index = 1 And KeyCode = 13 Then
      Call LoadDataD(Trim(txtFrmD(1).Text))
   End If
End Sub

⌨️ 快捷键说明

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