📄
字号:
End If
If Option12.Value = True Then
ll_orientation = 90
End If
'设置字体
ls_fontname = Combo2.Text
ll_fontstyle = Combo3.ListIndex
ll_fontsize = CInt(Combo4.Text)
'设置字的颜色
Select Case ImageCombo1.SelectedItem.Index
Case 1
ll_forecolor = RGB(0, 0, 0)
Case 2
ll_forecolor = RGB(128, 128, 128)
Case 3
ll_forecolor = RGB(128, 0, 0)
Case 4
ll_forecolor = RGB(128, 128, 0)
Case 5
ll_forecolor = RGB(0, 128, 0)
Case 6
ll_forecolor = RGB(0, 128, 128)
Case 7
ll_forecolor = RGB(0, 0, 128)
Case 8
ll_forecolor = RGB(128, 0, 128)
Case 9
ll_forecolor = RGB(128, 128, 64)
Case 10
ll_forecolor = RGB(0, 64, 64)
Case 11
ll_forecolor = RGB(0, 128, 255)
Case 12
ll_forecolor = RGB(0, 64, 128)
Case 13
ll_forecolor = RGB(64, 0, 255)
Case 14
ll_forecolor = RGB(128, 64, 0)
Case 15
ll_forecolor = RGB(255, 255, 255)
Case 16
ll_forecolor = RGB(255, 0, 0)
Case 17
ll_forecolor = RGB(255, 255, 0)
Case 18
ll_forecolor = RGB(0, 255, 0)
Case 19
ll_forecolor = RGB(0, 255, 255)
Case 20
ll_forecolor = RGB(0, 0, 255)
Case 21
ll_forecolor = RGB(255, 0, 255)
Case 22
ll_forecolor = RGB(255, 255, 128)
Case 23
ll_forecolor = RGB(0, 255, 128)
Case 24
ll_forecolor = RGB(128, 255, 255)
Case 25
ll_forecolor = RGB(128, 128, 255)
Case 26
ll_forecolor = RGB(255, 0, 128)
Case 27
ll_forecolor = RGB(255, 128, 64)
End Select
If SSTab1.TabVisible(2) = True Then
'设置%
If Check4.Value = Checked Then
ll_bfs = 1
Else
ll_bfs = 0
End If
'设置科学计数
If Check5.Value = Checked Then
ll_kxjs = 1
Else
ll_kxjs = 0
End If
ll_qfw = Combo5.ListIndex
ll_hbfh = Combo6.ItemData(Combo6.ListIndex)
ll_xsws = CInt(Text1.Text)
If Check6.Value = Checked Then
ll_zero = 0
Else
ll_zero = 1
End If
End If
If Check7.Value = Checked Then
ls_note = "1"
Else
ls_note = ""
End If
If Check1.Value = Checked Then
ls_read = True
Else
ls_read = False
End If
If Check2.Value = Checked Then
ls_hide = True
Else
ls_hide = False
End If
If Option13.Value = True Then
ls_zhdx1 = True
Else
ls_zhdx1 = False
End If
If Option14.Value = True Then
ls_zhdx2 = True
Else
ls_zhdx2 = False
End If
If Option15.Value = True Then
ls_zhdx3 = True
Else
ls_zhdx3 = False
End If
.Cell1.DoGetSelectRange ll_col_begin, ll_row_begin, ll_col_end, ll_row_end
For i = ll_col_begin To ll_col_end
For j = ll_row_begin To ll_row_end
.Cell1.DoSetCellAlignment i, j, ll_alignment
.Cell1.DoSetCellTextStyle i, j, ll_textstyle
.Cell1.DoSetCellTextOrientation i, j, ll_orientation
.Cell1.DoSetCellFont i, j, ll_fontsize, ll_fontstyle, ls_fontname
.Cell1.DoGetCellColor i, j, ll_forecolor_old, ll_backcolor
.Cell1.DoSetCellColor i, j, ll_forecolor, ll_backcolor
If SSTab1.TabVisible(2) = True Then
.Cell1.DoSetCellNumberStyle i, j, ll_qfw, ll_bfs, ll_xsws, ll_hbfh, 1, -1, ll_kxjs
.Cell1.DoSetCellShowZero i, j, ll_zero
End If
.Cell1.DoSetCellNote i, j, ls_note
.Cell1.DoSetCellReadOnly i, j, ls_read
.Cell1.DoSetCellPrintable i, j, ls_hide
If ls_zhdx1 = True Then
.Cell1.DoSetCellNote i, j, "转换1"
.Cell1.DoSetCellInputOnlyValue i, j, True, 9999999999#, False, 0
Else
If ls_zhdx2 = True Then
.Cell1.DoSetCellNote i, j, "转换2"
.Cell1.DoSetCellInputOnlyValue i, j, True, 9999999999#, False, 0
Else
If ls_zhdx3 = True Then
.Cell1.DoSetCellNote i, j, "转换3"
.Cell1.DoSetCellInputOnlyValue i, j, True, 9999999999#, False, 0
Else
If ls_note <> "1" Then
.Cell1.DoSetCellNote i, j, ""
End If
End If
End If
End If
Next j
Next i
.Cell1.DoRedrawAll
End With
Unload Me
End Sub
Private Sub command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
End Sub
Private Sub Form_Load()
Me.HelpContextID = "1012001"
Dim ll_col As Long, ll_row As Long, ll_alignment As Long
Dim ll_textstyle As Long, ll_fontsize, ll_fontstyle
Dim ls_fontname, ll_forecolor, ll_backcolor
Dim ll_qfw, ll_bfs, ll_xsws, ll_hbfh
Dim ll_unit, ll_fs, ll_kxjs, ls_note As String
Dim ll_orientation As Long
Dim ls_xsws
Dim i As Long
mf_init_color ImageCombo1
mf_init_combo2
With MDI_frame.ActiveForm
ll_col = .ml_col
ll_row = .ml_row
ll_alignment = .Cell1.DoGetCellAlignment(ll_col, ll_row)
'设置对齐
Select Case ll_alignment
Case 9
Option1.Value = True
Option4.Value = True
Case 33
Option1.Value = True
Option5.Value = True
Case 17
Option1.Value = True
Option6.Value = True
Case 12
Option2.Value = True
Option4.Value = True
Case 36
Option2.Value = True
Option5.Value = True
Case 20
Option2.Value = True
Option6.Value = True
Case 10
Option3.Value = True
Option4.Value = True
Case 34
Option3.Value = True
Option5.Value = True
Case 18
Option3.Value = True
Option6.Value = True
Case 0
If .Cell1.DoGetCellDataType(ll_col, ll_row) = 2 Then
Option3.Value = True
Option6.Value = True
Else
Option1.Value = True
Option6.Value = True
End If
End Select
'设置自动折行
ll_textstyle = .Cell1.DoGetCellTextStyle(ll_col, ll_row)
Select Case ll_textstyle
Case 0
Option7.Value = True
Case 1
Option8.Value = True
Case 2
Option9.Value = True
End Select
ll_orientation = .Cell1.DoGetCellTextOrientation(ll_col, ll_row)
Select Case ll_orientation
Case 0
Option10.Value = True
Case -90
Option11.Value = True
Case 90
Option2.Value = True
End Select
'设置字体
.Cell1.DoGetCellFont ll_col, ll_row, ll_fontsize, ll_fontstyle, ls_fontname
Combo4.Text = CStr(ll_fontsize)
Combo3.Text = Combo3.List(ll_fontstyle)
.Cell1.DoGetCellColor ll_col, ll_row, ll_forecolor, ll_backcolor
Select Case ll_forecolor
Case RGB(0, 0, 0), -1
ImageCombo1.ComboItems(1).Selected = True
Case RGB(128, 128, 128)
ImageCombo1.ComboItems(2).Selected = True
Case RGB(128, 0, 0)
ImageCombo1.ComboItems(3).Selected = True
Case RGB(128, 128, 0)
ImageCombo1.ComboItems(4).Selected = True
Case RGB(0, 128, 0)
ImageCombo1.ComboItems(5).Selected = True
Case RGB(0, 128, 128)
ImageCombo1.ComboItems(6).Selected = True
Case RGB(0, 0, 128)
ImageCombo1.ComboItems(7).Selected = True
Case RGB(128, 0, 128)
ImageCombo1.ComboItems(8).Selected = True
Case RGB(128, 128, 64)
ImageCombo1.ComboItems(9).Selected = True
Case RGB(0, 64, 64)
ImageCombo1.ComboItems(10).Selected = True
Case RGB(0, 128, 255)
ImageCombo1.ComboItems(11).Selected = True
Case RGB(0, 64, 128)
ImageCombo1.ComboItems(12).Selected = True
Case RGB(64, 0, 255)
ImageCombo1.ComboItems(13).Selected = True
Case RGB(128, 64, 0)
ImageCombo1.ComboItems(14).Selected = True
Case RGB(255, 255, 255)
ImageCombo1.ComboItems(15).Selected = True
Case RGB(255, 0, 0)
ImageCombo1.ComboItems(16).Selected = True
Case RGB(255, 255, 0)
ImageCombo1.ComboItems(17).Selected = True
Case RGB(0, 255, 0)
ImageCombo1.ComboItems(18).Selected = True
Case RGB(0, 255, 255)
ImageCombo1.ComboItems(19).Selected = True
Case RGB(0, 0, 255)
ImageCombo1.ComboItems(20).Selected = True
Case RGB(255, 0, 255)
ImageCombo1.ComboItems(21).Selected = True
Case RGB(255, 255, 128)
ImageCombo1.ComboItems(22).Selected = True
Case RGB(0, 255, 128)
ImageCombo1.ComboItems(23).Selected = True
Case RGB(128, 255, 255)
ImageCombo1.ComboItems(24).Selected = True
Case RGB(128, 128, 255)
ImageCombo1.ComboItems(25).Selected = True
Case RGB(255, 0, 128)
ImageCombo1.ComboItems(26).Selected = True
Case RGB(255, 128, 64)
ImageCombo1.ComboItems(27).Selected = True
End Select
.Cell1.DoGetCellNumberStyle ll_col, ll_row, ll_qfw, ll_bfs, ll_xsws, ll_hbfh, ll_unit, ll_fs, ll_kxjs
If ll_xsws = -1 Then
.Cell1.DoGetCellData ll_col, ll_row, ls_xsws
If InStr(1, ls_xsws, ".", vbTextCompare) > 0 Then
ll_xsws = Len(ls_xsws) - InStr(1, ls_xsws, ".", vbTextCompare)
Else
ll_xsws = 0
End If
End If
SSTab1.TabVisible(2) = True
If ll_bfs = 0 Then
Check4.Value = Unchecked
Else
Check4.Value = Checked
End If
If ll_kxjs = 1 Then
Check5.Value = Checked
Else
Check5.Value = Unchecked
End If
Combo5.Text = Combo5.List(ll_qfw)
For i = 0 To Combo6.ListCount() - 1
If Combo6.ItemData(i) = ll_hbfh Then
Combo6.Text = Combo6.List(i)
End If
Next i
Text1.Text = CStr(ll_xsws)
If .Cell1.DoGetCellShowZero(ll_col, ll_row) = 1 Then
Check6.Value = Checked
Else
Check6.Value = Unchecked
End If
ls_note = .Cell1.DoGetCellNote(ll_col, ll_row)
If Left(ls_note, 1) = "1" Then
Check7.Value = Checked
Else
Check7.Value = Unchecked
End If
End With
End Sub
Private Sub ImageCombo1_Click()
Text2.SetFocus
End Sub
Private Sub ImageCombo1_KeyDown(KeyCode As Integer, Shift As Integer)
KeyCode = 0
End Sub
Private Sub Text1_Change()
If Len(Trim(Text1.Text)) = 0 Then
Text1.Text = "0"
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If Not (KeyAscii >= Asc("0") And KeyAscii <= Asc("9") Or KeyAscii = vbKeyBack) Then
KeyAscii = 0
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -