?? form1.frm
字號:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5310
ClientLeft = 3405
ClientTop = 3960
ClientWidth = 8490
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 5310
ScaleWidth = 8490
Begin VB.CommandButton Command6
Caption = "幫朋友做下廣告"
Height = 375
Left = 480
TabIndex = 13
Top = 4560
Width = 4815
End
Begin VB.Timer Timer1
Interval = 16000
Left = 5640
Top = 4320
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2775
Left = 240
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 11
Top = 1320
Width = 5295
End
Begin VB.CheckBox Check1
Caption = "發送時間"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6120
TabIndex = 8
Top = 3600
Width = 1335
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 6240
TabIndex = 7
Text = "COM1"
Top = 480
Width = 975
End
Begin MSComDlg.CommonDialog CDialog1
Left = 5160
Top = 720
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton Command3
Caption = "退出"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 6480
TabIndex = 4
Top = 4320
Width = 975
End
Begin VB.Frame Frame2
Caption = "串口/字體選擇"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 6120
TabIndex = 3
Top = 240
Width = 2295
Begin VB.ComboBox Combo2
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1200
TabIndex = 12
Text = "宋體"
Top = 240
Width = 975
End
End
Begin VB.CommandButton Command2
BackColor = &H80000010&
Caption = "清除"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 1
Top = 240
Width = 975
End
Begin VB.CommandButton Command1
BackColor = &H80000010&
Caption = "發送"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3240
TabIndex = 0
Top = 840
Width = 975
End
Begin MSCommLib.MSComm MSComm1
Left = 4560
Top = 240
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
OutBufferSize = 1024
End
Begin VB.Frame Frame1
Caption = "發送"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 4095
Left = 120
TabIndex = 2
Top = 120
Width = 5655
Begin VB.CommandButton Command4
Caption = "打開"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1800
TabIndex = 10
Top = 120
Width = 975
End
Begin VB.CommandButton Command5
Caption = "保存"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1800
TabIndex = 9
Top = 720
Width = 975
End
Begin VB.Label Label4
Caption = "發送字長:"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 6
Top = 720
Width = 855
End
Begin VB.Label Label3
Caption = "Label3"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1080
TabIndex = 5
Top = 720
Width = 735
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim mypath1 '文件所在的文件夾
Dim zitipath '字體所在路徑
'Dim Rec(512) As Integer
Dim n As Integer '文本計數用hzLen()
Dim hzstr1() As String '從文本中取出的中文存放的一個數組
Dim jnmstr() '存儲機內碼
'Dim qwm '存儲區位碼
Dim address1 '存放在hzk16中的地址
Dim zmhp() As Byte '定義橫排字存放的樹組
Dim zmsp() As Byte '定義豎排字存放的數組
'Private Sub Check1_Click()
'Call subsendtime
'Else
'Timer1.Enabled = False
'End Sub
Private Sub Combo2_Click() '文本框字體控制
If Combo2.Text = "宋體" Then Text1.Font = "宋體"
If Combo2.Text = "仿宋" Then Text1.Font = "仿宋_GB2312"
If Combo2.Text = "楷體" Then Text1.Font = "楷體_GB2312"
If Combo2.Text = "黑體" Then Text1.Font = "黑體"
End Sub
'Dim t3 As Integer
Private Sub Command1_Click() '發送
If Text1.Text = "" Then
X = MsgBox("發送數據不能為空", 16)
End If
On Error Resume Next
Call hzLenandstore '統計出文本中字符串的長度
Call Subchange1 '把漢字從字庫中取出來并橫排存放在數組zmhp()
Call subchange2 '將橫排漢字轉換為豎排存放
'Label3.Caption = n
'******************************************
'Dim send1 As Byte
'For i = 1 To n
'For j = 1 To 32
'send1 = zmhp(i, j)
'MSComm1.Output = zmhp(i, j)
'Debug.Print Hex(zmhp(i, j)) & "H,";
'Next j
'Debug.Print "/*"; hzstr1(i); "*/"
'Debug.Print Chr(13)
'Next i
'Dim send1 As Byte
'**********************************************打開端口號控制部分*
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
Dim port 'As Integer
If Combo1.Text = "COM1" Then port = 1
If Combo1.Text = "COM2" Then port = 2
If Combo1.Text = "COM3" Then port = 3
If Combo1.Text = "COM4" Then port = 4
MSComm1.CommPort = port
If MSComm1.PortOpen = False Then MSComm1.PortOpen = True '判斷串口是否打開
'***********************************************字體控制部分***
If Combo2.Text = "宋體" Then zitipahth = mypath1 & "hzk16"
If Combo2.Text = "仿宋" Then zitipahth = mypath1 & "hzk16f"
If Combo2.Text = "楷體" Then zitipahth = mypath1 & "hzk16"
If Combo2.Text = "黑體" Then zitipahth = mypath1 & "hzk16"
'****************************************************
'***************************************橫排發送*********
Dim send1(1 To 1024) As Byte '定義要發送的數組.
Dim m As Integer
'Debug.Print
send1(1) = CByte(n)
send1(2) = CByte(n)
send1(3) = CByte(n) '發送要輸出字的長度,便于單片機控制屏幕顯示,此為長度控制,在單片中的存放位置為text[1]
send1(4) = n
For i = 5 To 1024 '采用固定字節發送,
send1(i) = CByte(&H0) '給要發送的定字長所有數據先清0
Next i
m = 33 '根據屏幕的大小給出要發送字的起始位置
'MSComm1.OutBufferCount = 0
'MSComm1.Output = CByte(n)
For i = 1 To n
For j = 1 To 32
send1(m) = zmsp(i, j) '把要發送的字的字模按字的先后存入一個數組里
'MSComm1.Output = zmhp(i, j) '發送數據
'Debug.Print "&H"; Hex(zmsp(i, j)) & ",";
'Debug.Print Hex(send1(m)) & "H,";
m = m + 1
Next j
'MSComm1.Output = send1
'Debug.Print "/*"; hzstr1(i); "*/"
'Debug.Print Chr(13)
Next i
MSComm1.OutBufferCount = 0 '發送緩沖區清空
MSComm1.Output = send1() '將數據發送個單片機
End Sub
Private Sub Command2_Click() '清除
Text1.Text = ""
End Sub
Private Sub Command3_Click() '退出
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -