📄 dlgparagraph.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form DlgParagraph
BorderStyle = 3 'Fixed Dialog
Caption = "Paragraph"
ClientHeight = 3255
ClientLeft = 45
ClientTop = 330
ClientWidth = 5175
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3255
ScaleWidth = 5175
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "Cancel"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 4020
TabIndex = 10
Top = 2760
Width = 1020
End
Begin VB.CommandButton cmdOK
Caption = "OK"
Default = -1 'True
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 2880
TabIndex = 9
Top = 2760
Width = 1020
End
Begin VB.ComboBox comAlign
Height = 315
Left = 1440
Style = 2 'Dropdown List
TabIndex = 1
Top = 300
Width = 975
End
Begin MSComCtl2.UpDown UDLeft
Height = 285
Left = 2160
TabIndex = 5
Top = 1095
Width = 240
_ExtentX = 423
_ExtentY = 503
_Version = 393216
OrigLeft = 2160
OrigTop = 840
OrigRight = 2400
OrigBottom = 1125
Max = 99
Enabled = -1 'True
End
Begin VB.TextBox txtLeftIndent
Height = 285
Left = 1440
TabIndex = 4
Text = "0"
Top = 1080
Width = 975
End
Begin MSComCtl2.UpDown UDRight
Height = 285
Left = 2160
TabIndex = 6
Top = 1455
Width = 240
_ExtentX = 423
_ExtentY = 503
_Version = 393216
OrigLeft = 2160
OrigTop = 840
OrigRight = 2400
OrigBottom = 1125
Max = 99
Enabled = -1 'True
End
Begin VB.TextBox txtRightIndent
Height = 285
Left = 1440
TabIndex = 7
Text = "0"
Top = 1440
Width = 975
End
Begin MSComCtl2.UpDown UDHanging
Height = 285
Left = 2160
TabIndex = 11
Top = 2175
Width = 240
_ExtentX = 423
_ExtentY = 503
_Version = 393216
OrigLeft = 2160
OrigTop = 840
OrigRight = 2400
OrigBottom = 1125
Max = 99
Enabled = -1 'True
End
Begin VB.TextBox txtHangingIndent
Height = 285
Left = 1440
TabIndex = 12
Text = "0"
Top = 2160
Width = 975
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "Hanging:"
Height = 195
Left = 480
TabIndex = 13
Top = 2205
Width = 645
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "Right:"
Height = 195
Left = 480
TabIndex = 8
Top = 1485
Width = 420
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "Left:"
Height = 195
Left = 480
TabIndex = 3
Top = 1125
Width = 315
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Indentation"
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Left = 240
TabIndex = 2
Top = 720
Width = 840
End
Begin VB.Line Line1
BorderColor = &H00FFFFFF&
BorderStyle = 6 'Inside Solid
Index = 1
X1 = 1200
X2 = 5040
Y1 = 840
Y2 = 840
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Alignment"
Height = 195
Left = 240
TabIndex = 0
Top = 360
Width = 690
End
Begin VB.Line Line1
BorderColor = &H00808080&
BorderWidth = 2
Index = 0
X1 = 1200
X2 = 5040
Y1 = 840
Y2 = 840
End
End
Attribute VB_Name = "DlgParagraph"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim LeftI As Double
Dim RightI As Double
If Not IsNumeric(txtLeftIndent) Then
MsgBox "This is not a valid measurement.", vbExclamation
txtLeftIndent.SetFocus
Exit Sub
End If
If Not IsNumeric(txtRightIndent) Then
MsgBox "This is not a valid measurement.", vbExclamation
txtRightIndent.SetFocus
Exit Sub
End If
LeftI = txtLeftIndent.Text
RightI = txtRightIndent.Text
HangingI = txtHangingIndent.Text
Unload Me
MDIfrm.ActiveForm.Document_.SelIndent = (LeftI * (567 * 2.55))
MDIfrm.ActiveForm.Document_.SelRightIndent = (RightI * (567 * 2.55))
MDIfrm.ActiveForm.Document_.SelHangingIndent = (HangingI * (567 * 2.55))
End Sub
Private Sub Form_Load()
comAlign.AddItem "Left"
comAlign.AddItem "Right"
comAlign.AddItem "Center"
For i = 0 To 2
If i = MDIfrm.ActiveForm.Document_.SelAlignment Then
comAlign.ListIndex = i
Exit For
End If
Next i
txtLeftIndent.Text = Format(MDIfrm.ActiveForm.Document_.SelIndent / (567 * 2.55), "0.0")
txtRightIndent.Text = Format(MDIfrm.ActiveForm.Document_.SelRightIndent / (567 * 2.55), "0.0")
txtHangingIndent.Text = Format(MDIfrm.ActiveForm.Document_.SelHangingIndent / (567 * 2.55), "0.0")
End Sub
Private Sub UDLeft_DownClick()
If CDbl(txtLeftIndent.Text) = -99 Then Exit Sub
txtLeftIndent.Text = CDbl(txtLeftIndent.Text) - 0.1
End Sub
Private Sub UDLeft_UpClick()
If CDbl(txtLeftIndent.Text) = 99 Then Exit Sub
txtLeftIndent.Text = CDbl(txtLeftIndent.Text) + 0.1
End Sub
Private Sub UDright_DownClick()
If CDbl(txtRightIndent.Text) = -99 Then Exit Sub
txtRightIndent.Text = CDbl(txtRightIndent.Text) - 0.1
End Sub
Private Sub UDright_UpClick()
If CDbl(txtRightIndent.Text) = 99 Then Exit Sub
txtRightIndent.Text = CDbl(txtRightIndent.Text) + 0.1
End Sub
Private Sub UDHanging_DownClick()
If CDbl(txtHangingIndent.Text) = -99 Then Exit Sub
txtHangingIndent.Text = CDbl(txtHangingIndent.Text) - 0.1
End Sub
Private Sub UDHanging_UpClick()
If CDbl(txtHangingIndent.Text) = 99 Then Exit Sub
txtHangingIndent.Text = CDbl(txtHangingIndent.Text) + 0.1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -