📄 frmcoord.frm
字号:
VERSION 5.00
Begin VB.Form frmCoord
BackColor = &H8000000A&
BorderStyle = 3 'Fixed Dialog
Caption = "坐标设置"
ClientHeight = 2550
ClientLeft = 45
ClientTop = 330
ClientWidth = 4740
FillColor = &H00FFFFFF&
ForeColor = &H80000017&
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2550
ScaleWidth = 4740
ShowInTaskbar = 0 'False
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdCancel
Caption = "取 消"
Height = 375
Left = 2640
TabIndex = 11
Top = 1920
Width = 1455
End
Begin VB.CommandButton cmdOK
Caption = "确 定"
Height = 375
Left = 600
TabIndex = 10
Top = 1920
Width = 1455
End
Begin VB.Frame Frame2
BackColor = &H8000000A&
Height = 765
Left = 240
TabIndex = 5
Top = 960
Width = 4305
Begin VB.TextBox txtYpos
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 3000
TabIndex = 7
Top = 240
Width = 1065
End
Begin VB.TextBox txtXpos
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 960
TabIndex = 6
Top = 240
Width = 960
End
Begin VB.Label Label5
AutoSize = -1 'True
BackColor = &H8000000A&
Caption = "横坐标"
BeginProperty Font
Name = "Microsoft Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400000&
Height = 195
Left = 240
TabIndex = 9
Top = 300
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
BackColor = &H8000000A&
Caption = "纵坐标"
BeginProperty Font
Name = "Microsoft Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400000&
Height = 195
Left = 2280
TabIndex = 8
Top = 300
Width = 540
End
End
Begin VB.Frame Frame3
BackColor = &H8000000A&
Height = 885
Left = 240
TabIndex = 0
Top = 0
Width = 4305
Begin VB.ComboBox cboFontName
Appearance = 0 'Flat
Height = 315
Left = 960
TabIndex = 2
Top = 360
Width = 1125
End
Begin VB.ComboBox cboFontSize
Appearance = 0 'Flat
Height = 315
Left = 3000
TabIndex = 1
Top = 360
Width = 1155
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H8000000A&
Caption = "字体名称"
BeginProperty Font
Name = "Microsoft Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400000&
Height = 195
Left = 120
TabIndex = 4
Top = 405
Width = 720
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H8000000A&
Caption = "字体大小"
BeginProperty Font
Name = "Microsoft Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00400000&
Height = 195
Left = 2160
TabIndex = 3
Top = 405
Width = 720
End
End
End
Attribute VB_Name = "frmCoord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim txtBoxName As String '文本框名
Dim strFrmName As String '窗体名称
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOk_Click()
Dim strSaveInfo As String
'保存坐标设置 格式:
'程序名,打印坐标设置,文本框名+窗体名,字体,字号,X坐标,Y坐标
strSaveInfo = Trim(cboFontName.Text & "," & cboFontSize.Text & "," & txtXpos.Text & "," & txtYpos)
SaveSetting App.EXEName, "打印坐标设置", txtBoxName & strFrmName, strSaveInfo
Me.Hide
End Sub
Private Sub Form_Load()
Dim i As Integer
txtBoxName = ""
strFrmName = ""
On Error GoTo err
For i = 0 To Printer.FontCount - 1
cboFontName.AddItem Printer.Fonts(i)
Next i
For i = 2 To 72 Step 2
cboFontSize.AddItem i
Next i
Exit Sub
err:
MsgBox "请首先设置好打印机", vbInformation
End Sub
Sub ShowFontSetting(ByVal objName As String, ByVal strfrm)
Dim strTemp As String
On Error GoTo err
txtBoxName = objName
strFrmName = strfrm
Me.cboFontName = ""
Me.cboFontSize = ""
Me.txtXpos = ""
Me.txtYpos = ""
'从注册表读起保存设置
'格式:
'程序名,打印坐标设置,文本框名+窗体名,字体,字号,X坐标,Y坐标
strTemp = GetSetting(App.EXEName, "打印坐标设置", txtBoxName & strFrmName)
If strTemp <> "" Then '从长字符串中分出字符段
Me.cboFontName = GetString(strTemp, 1, ",")
Me.cboFontSize = GetString(strTemp, 2, ",")
Me.txtXpos = GetString(strTemp, 3, ",")
Me.txtYpos = GetString(strTemp, 4, ",")
End If
Exit Sub
err:
MsgBox err.Description
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -