📄 行高列宽.frm
字号:
VERSION 5.00
Object = "{A0C292A3-118E-11D2-AFDF-000021730160}#1.0#0"; "UFEDIT.OCX"
Begin VB.Form frmRowHColW
Appearance = 0 'Flat
AutoRedraw = -1 'True
BorderStyle = 4 'Fixed ToolWindow
Caption = "行高列宽"
ClientHeight = 1275
ClientLeft = 45
ClientTop = 285
ClientWidth = 3480
DrawMode = 6 'Mask Pen Not
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1275
ScaleWidth = 3480
ShowInTaskbar = 0 'False
Begin VB.Frame fraRowHColW
Caption = "行高"
Height = 1215
Left = 53
TabIndex = 0
Top = 0
Visible = 0 'False
Width = 3375
Begin EDITLib.Edit txtValue
Height = 375
Left = 960
TabIndex = 1
Top = 720
Width = 855
_Version = 65536
_ExtentX = 1508
_ExtentY = 661
_StockProps = 253
ForeColor = 0
BackColor = 16777215
Appearance = 1
Property = 4
NumPoint = 3
MaxLength = 8
End
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 2400
TabIndex = 5
Top = 720
Width = 855
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Height = 375
Left = 2400
TabIndex = 4
Top = 240
Width = 855
End
Begin VB.OptionButton optCustom
Caption = "定制"
Height = 375
Left = 120
TabIndex = 3
Top = 720
Value = -1 'True
Width = 735
End
Begin VB.OptionButton optFit
Caption = "自适应"
Height = 375
Left = 120
TabIndex = 2
Top = 240
Width = 2175
End
Begin VB.Label lblmm
AutoSize = -1 'True
Caption = "毫米"
Height = 195
Left = 1920
TabIndex = 6
Top = 810
Width = 360
End
End
End
Attribute VB_Name = "frmRowHColW"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Status As Integer
Private Sub cmdOK_Click()
If Not optFit.Value Then
If Val(txtValue.Text) > 577.9 Then
MsgBox "数值太大了!", vbInformation, App.ProductName
Exit Sub
End If
End If
Select Case fraRowHColW.Caption
Case "行高"
If optFit.Value Then
frmVchDefine.objF1Book.SetRowHeightAuto frmVchDefine.lDownRow, frmVchDefine.lDownCol, frmVchDefine.lUpRow, frmVchDefine.lUpCol, True
Else
frmVchDefine.objF1Book.SetRowHeight frmVchDefine.lDownRow, frmVchDefine.lUpRow, txtValue.Text * 0.03937 * 1440, False
End If
Case "列宽"
If optFit.Value Then
frmVchDefine.objF1Book.SetColWidthAuto frmVchDefine.lDownRow, frmVchDefine.lDownCol, frmVchDefine.lUpRow, frmVchDefine.lUpCol, True
Else
frmVchDefine.objF1Book.SetColWidth frmVchDefine.lDownCol, frmVchDefine.lUpCol, txtValue.Text * 0.03937 * 1440, False
End If
End Select
Unload Me
End Sub
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub txtValue_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
Call cmdOK_Click
End If
End Sub
Private Sub Form_Load()
Dim Temp As Long
If Status = 0 Then
With Me:
Caption = "设置行高度"
fraRowHColW.Visible = True
Me.Cls
Me.Width = 3570
Me.Height = 1605
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
fraRowHColW.Top = 0
fraRowHColW.Left = 53
Select Case fraRowHColW.Caption
Case "行高"
txtValue.Text = Format(frmVchDefine.objF1Book.RowHeight(frmVchDefine.lUpRow) / 0.03937 / 1440, "#0.000")
Case "列宽"
txtValue.Text = Format(frmVchDefine.objF1Book.ColWidth(frmVchDefine.lUpCol) / 0.03937 / 1440, "#0.000")
End Select
End With
ElseIf Status = 1 Then
With Me:
Caption = "设置列宽度"
fraRowHColW.Visible = True
Me.Cls
Me.Width = 3570
Me.Height = 1605
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
fraRowHColW.Top = 0
fraRowHColW.Left = 53
fraRowHColW.Caption = "列宽"
Select Case fraRowHColW.Caption
Case "行高"
txtValue.Text = Format(frmVchDefine.objF1Book.RowHeight(frmVchDefine.lUpRow) / 0.03937 / 1440, "#0.000")
Case "列宽"
txtValue.Text = Format(frmVchDefine.objF1Book.ColWidth(frmVchDefine.lUpCol) / 0.03937 / 1440, "#0.000")
End Select
End With
End If
End Sub
Private Sub optFit_Click()
txtValue.Enabled = False
End Sub
Private Sub optCustom_Click()
txtValue.Enabled = True
End Sub
Private Sub txtValue_KeyPress(KeyAscii As Integer)
If KeyAscii = Asc("-") Then KeyAscii = 0
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -