📄 setfrm.frm
字号:
VERSION 5.00
Begin VB.Form setfrm
BackColor = &H00E0E0E0&
BorderStyle = 4 'Fixed ToolWindow
Caption = "端口及其他设置"
ClientHeight = 5265
ClientLeft = 3960
ClientTop = 3495
ClientWidth = 4875
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5265
ScaleWidth = 4875
ShowInTaskbar = 0 'False
Begin VB.Frame OtherOP
BackColor = &H00E0E0E0&
Caption = "其他选项"
Height = 735
Left = 120
TabIndex = 19
Top = 3840
Width = 4635
Begin VB.CheckBox Check1
BackColor = &H00E0E0E0&
Caption = "文件接收完毕后提示是否打开保存文件的所在目录"
Height = 195
Left = 180
TabIndex = 20
Top = 300
Width = 4335
End
End
Begin 工程1.chameleonButton savedefault
Height = 375
Left = 120
TabIndex = 14
ToolTipText = "恢复默认的设置"
Top = 4740
Width = 1215
_ExtentX = 2143
_ExtentY = 661
BTYPE = 3
TX = "恢复默认"
ENAB = -1 'True
BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
COLTYPE = 1
FOCUSR = -1 'True
BCOL = 13160660
FCOL = 0
End
Begin 工程1.chameleonButton cancel
Height = 375
Left = 3660
TabIndex = 13
ToolTipText = "不保存所更改的设置而直接关闭窗口"
Top = 4740
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BTYPE = 3
TX = "取消"
ENAB = -1 'True
BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
COLTYPE = 1
FOCUSR = -1 'True
BCOL = 13160660
FCOL = 0
End
Begin 工程1.chameleonButton saveOption
Height = 375
Left = 2460
TabIndex = 12
ToolTipText = "保存所做的设置"
Top = 4740
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BTYPE = 3
TX = "保存设置"
ENAB = -1 'True
BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
COLTYPE = 1
FOCUSR = -1 'True
BCOL = 13160660
FCOL = 0
End
Begin VB.Frame FaceOP
BackColor = &H00E0E0E0&
Caption = "程序界面设置"
Height = 2655
Left = 120
TabIndex = 5
Top = 1080
Width = 4635
Begin 工程1.ColorPicker cl1
Height = 315
Left = 2220
TabIndex = 18
Top = 2160
Width = 2175
_ExtentX = 3836
_ExtentY = 556
默认颜色 = 14737632
End
Begin VB.ComboBox buttonstyle
Height = 300
Left = 2220
Style = 2 'Dropdown List
TabIndex = 17
Top = 1680
Width = 2175
End
Begin VB.ComboBox pb2style
Height = 300
Left = 2220
Style = 2 'Dropdown List
TabIndex = 16
Top = 960
Width = 2175
End
Begin VB.ComboBox pb1style
Height = 300
Left = 2220
Style = 2 'Dropdown List
TabIndex = 15
Top = 240
Width = 2175
End
Begin 工程1.Xp_ProgressBar pb2
Height = 195
Left = 240
TabIndex = 9
Top = 1320
Width = 4155
_ExtentX = 7329
_ExtentY = 344
Value = 50
End
Begin 工程1.Xp_ProgressBar pb1
Height = 195
Left = 240
TabIndex = 6
Top = 600
Width = 4155
_ExtentX = 7329
_ExtentY = 344
Value = 50
ProgressLook = 2
End
Begin VB.Label Label6
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "窗体颜色:"
Height = 180
Left = 180
TabIndex = 11
Top = 2220
Width = 810
End
Begin VB.Label Label5
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "按钮风格:"
Height = 180
Left = 180
TabIndex = 10
Top = 1740
Width = 810
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "接收进度条颜色:"
Height = 180
Left = 180
TabIndex = 8
Top = 1020
Width = 1350
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "发送进度条颜色:"
Height = 180
Left = 180
TabIndex = 7
Top = 300
Width = 1350
End
End
Begin VB.Frame PortOp
BackColor = &H00E0E0E0&
Caption = "占用端口设置"
Height = 855
Left = 120
TabIndex = 0
Top = 120
Width = 4635
Begin VB.TextBox porttwo
Alignment = 2 'Center
Height = 270
Left = 3360
MaxLength = 5
TabIndex = 4
ToolTipText = "请填入1-65535之间用来通讯的某个未被其他程序所占用的端口号"
Top = 300
Width = 795
End
Begin VB.TextBox portone
Alignment = 2 'Center
Height = 270
Left = 1320
MaxLength = 5
TabIndex = 2
ToolTipText = "请填入1-65535之间用来通讯的某个未被其他程序所占用的端口号"
Top = 300
Width = 795
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "占用端口 2:"
Height = 180
Left = 2280
TabIndex = 3
Top = 360
Width = 990
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "占用端口 1:"
Height = 180
Left = 300
TabIndex = 1
Top = 360
Width = 990
End
End
End
Attribute VB_Name = "setfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'这个窗体没啥好注释的.就是作一些保存设置
'代码写得很垃圾烦琐
'唉
Option Explicit
Private Sub buttonstyle_Click()
savedefault.ButtonType = buttonstyle.ListIndex + 1
saveOption.ButtonType = buttonstyle.ListIndex + 1
cancel.ButtonType = buttonstyle.ListIndex + 1
End Sub
Private Sub cancel_Click()
Unload Me
End Sub
Private Sub cl1_Click()
setfrm.BackColor = cl1.Color
PortOp.BackColor = cl1.Color
FaceOP.BackColor = cl1.Color
OtherOP.BackColor = cl1.Color
Check1.BackColor = cl1.Color
End Sub
Private Sub Form_Load()
portone.Text = port
porttwo.Text = port2
pb1.ProgressLook = MainFrm.XpPB1.ProgressLook
pb2.ProgressLook = MainFrm.XpPB2.ProgressLook
setfrm.BackColor = MainFrm.BackColor
PortOp.BackColor = setfrm.BackColor
FaceOP.BackColor = setfrm.BackColor
OtherOP.BackColor = setfrm.BackColor
Check1.BackColor = setfrm.BackColor
If tishi = True Then
Check1.Value = 1
Else
Check1.Value = 0
End If
saveOption.ButtonType = MainFrm.TCPconnect.ButtonType
pb1.Value = 50
pb2.Value = 50
pb1style.List(0) = "默认"
pb1style.List(1) = "蓝色"
pb1style.List(2) = "黑色"
pb1style.List(3) = "金黄"
pb1style.List(4) = "深绿"
pb1style.List(5) = "灰色"
pb1style.List(6) = "黄色"
pb1style.List(7) = "红色"
pb2style.List(0) = "默认"
pb2style.List(1) = "蓝色"
pb2style.List(2) = "黑色"
pb2style.List(3) = "金黄"
pb2style.List(4) = "深绿"
pb2style.List(5) = "灰色"
pb2style.List(6) = "黄色"
pb2style.List(7) = "红色"
buttonstyle.List(0) = "Windows 3.1"
buttonstyle.List(1) = "Windows 9X"
buttonstyle.List(2) = "Windows XP"
buttonstyle.List(3) = "Mac"
'buttonstyle.List(4) = "Java Meta"
buttonstyle.List(4) = "Netscape6"
buttonstyle.List(5) = "Simple Falt"
pb1style.Text = pb1style.List(pb1.ProgressLook)
pb2style.Text = pb2style.List(pb2.ProgressLook)
buttonstyle.Text = buttonstyle.List(saveOption.ButtonType - 1)
cl1.Color = Me.BackColor
End Sub
Private Sub pb1style_Click()
pb1.ProgressLook = pb1style.ListIndex
pb1.Value = 0
pb1.Value = 50
End Sub
Private Sub pb2style_Click()
pb2.ProgressLook = pb2style.ListIndex
pb2.Value = 0
pb2.Value = 50
End Sub
Private Sub portone_KeyPress(KeyAscii As Integer)
'If KeyAscii < 48 Or KeyAscii > 57 Then
' If KeyAscii <> 8 Then
' KeyAscii = 0
' End If
'End If
End Sub
Private Sub porttwo_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
If KeyAscii <> 8 Then
KeyAscii = 0
End If
End If
End Sub
Private Sub savedefault_Click()
Me.BackColor = 14737632
PortOp.BackColor = 14737632
FaceOP.BackColor = 14737632
OtherOP.BackColor = 14737632
Check1.BackColor = 14737632
cl1.Color = 14737632
pb1.ProgressLook = 0
pb2.ProgressLook = 3
savedefault.ButtonType = 3
saveOption.ButtonType = 3
cancel.ButtonType = 3
pb1style.Text = pb1style.List(0)
pb2style.Text = pb2style.List(3)
buttonstyle.Text = buttonstyle.List(2)
End Sub
Private Sub saveOption_Click()
On Error GoTo err:
If portone.Text > 1 And portone.Text < 65536 And porttwo.Text > 1 And porttwo.Text < 65536 And portone.Text <> porttwo.Text Then
port = portone.Text
port2 = porttwo.Text
Else
XMsgBox "请正确填写1-65535之间的数字作为端口号.且两个端口号不能为同一数字!", vbInformation, "端口号无效!", ChartFrm.Picture3
Exit Sub
End If
With MainFrm
.BackColor = cl1.Color
.FileInFo = cl1.Color
.helpbutton.ButtonType = buttonstyle.ListIndex + 1
.SDFilebrowse.ButtonType = buttonstyle.ListIndex + 1
.SDFileStart.ButtonType = buttonstyle.ListIndex + 1
.Chart.ButtonType = buttonstyle.ListIndex + 1
.TCPconnect.ButtonType = buttonstyle.ListIndex + 1
.XpPB1.ProgressLook = pb1.ProgressLook
End With
Dim a As Long
a = MainFrm.XpPB1.Value
MainFrm.XpPB1.Value = 0
MainFrm.XpPB1.Value = a
MainFrm.XpPB2.ProgressLook = pb2.ProgressLook
a = MainFrm.XpPB2.Value
MainFrm.XpPB2.Value = 0
MainFrm.XpPB2.Value = a
ChartFrm.BackColor = cl1.Color
ChartFrm.SendWord.ButtonType = buttonstyle.ListIndex + 1
ChartFrm.txtshow.BackColor = cl1.Color
Call myWriteINI(path & "sendfile.ini", "Face", "ButtonStyle", saveOption.ButtonType)
Call myWriteINI(path & "sendfile.ini", "Face", "SdPBcolor", pb1.ProgressLook)
Call myWriteINI(path & "sendfile.ini", "Face", "GtPBcolor", pb2.ProgressLook)
Call myWriteINI(path & "sendfile.ini", "Face", "FormColor", cl1.Color)
If Check1.Value = 0 Then
Call myWriteINI(path & "sendfile.ini", "Option", "AutoCu", "0")
tishi = False
ElseIf Check1.Value = 1 Then
Call myWriteINI(path & "sendfile.ini", "Option", "AutoCu", "1")
tishi = True
End If
Unload Me
Exit Sub
err:
If err.Number = 13 Then
XMsgBox "端口号只能为纯数字!请重新填写!", vbInformation, "无效端口号", ChartFrm.Picture3
Exit Sub
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -