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

📄 pagesetup.frm

📁 一个用vb谢的编辑文本的工具
💻 FRM
字号:
VERSION 5.00
Begin VB.Form form5 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Page Setup"
   ClientHeight    =   1305
   ClientLeft      =   3075
   ClientTop       =   2730
   ClientWidth     =   3270
   Icon            =   "PageSetup.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   1305
   ScaleWidth      =   3270
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "&Cancel"
      Height          =   375
      Left            =   2160
      TabIndex        =   6
      Top             =   780
      Width           =   975
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "&OK"
      Default         =   -1  'True
      Height          =   375
      Left            =   2160
      TabIndex        =   5
      Top             =   240
      Width           =   975
   End
   Begin VB.Frame Frame1 
      Caption         =   "Margins"
      Height          =   1155
      Left            =   120
      TabIndex        =   0
      Top             =   60
      Width           =   1935
      Begin VB.TextBox txtRight 
         Height          =   285
         Left            =   720
         TabIndex        =   4
         Top             =   720
         Width           =   1095
      End
      Begin VB.TextBox txtLeft 
         Height          =   285
         Left            =   720
         TabIndex        =   2
         Top             =   300
         Width           =   1095
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "Right"
         Height          =   195
         Left            =   120
         TabIndex        =   3
         Top             =   780
         Width           =   375
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "Left"
         Height          =   195
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   270
      End
   End
End
Attribute VB_Name = "form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    If Val(txtLeft.Text) < 0 Then
        MsgBox "El margen izquierdo no puede ser menor a 1", 16, "Margen"
        txtLeft.SelStart = 0
        txtLeft.SelLength = Len(txtLeft.Text)
        txtLeft.SetFocus
    ElseIf Val(txtRight.Text) < 0 Then
        MsgBox "El margen derecho no puede ser menor a 1", 16, "Margen"
        txtRight.SelStart = 0
        txtRight.SelLength = Len(txtRight.Text)
        txtRight.SetFocus
    Else
        Dim lngOldStart As Long
        Dim lngOldLength As Long
        With ChildForms(frm).text1
            lngOldStart = .SelStart
            lngOldLength = .SelLength
            .SelStart = 0
            .SelLength = Len(.Text)
            .SelIndent = CInt(Val(txtLeft.Text) * 1440)
            .SelRightIndent = CInt(Val(txtRight.Text) * 1440)
            .SelStart = lngOldStart
            .SelLength = lngOldLength
        End With
        Unload Me
    End If
End Sub

Private Sub Form_Load()
    With ChildForms(frm).text1
        Dim sglLeft As Single
        Dim sglRight As Single
        sglLeft = .SelIndent
        sglLeft = sglLeft / 1440#
        sglLeft = CInt(sglLeft * 100#)
        sglLeft = sglLeft / 100#
        txtLeft.Text = Trim(Str(sglLeft))
        sglRight = .SelRightIndent
        sglRight = sglRight / 1440#
        sglRight = CInt(sglRight * 100#)
        sglRight = sglRight / 100#
        txtRight.Text = Trim(Str(sglRight))
    End With
End Sub


⌨️ 快捷键说明

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