?? form5.frm
字號(hào):
VERSION 5.00
Begin VB.Form Form5
BorderStyle = 1 'Fixed Single
Caption = "自助模式"
ClientHeight = 4725
ClientLeft = 4305
ClientTop = 2475
ClientWidth = 3765
Icon = "Form5.frx":0000
LinkTopic = "Form5"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4725
ScaleWidth = 3765
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame2
Caption = "用戶語(yǔ)錄"
Enabled = 0 'False
Height = 1260
Left = 75
TabIndex = 4
Top = 1050
Width = 3615
Begin VB.CommandButton Command6
Caption = "整理"
Enabled = 0 'False
Height = 270
Left = 1255
TabIndex = 12
Top = 870
Width = 720
End
Begin VB.CommandButton Command5
Caption = "導(dǎo)入"
Enabled = 0 'False
Height = 270
Left = 2030
TabIndex = 11
Top = 870
Width = 720
End
Begin VB.CommandButton Command4
Caption = "導(dǎo)出"
Enabled = 0 'False
Height = 270
Left = 2805
TabIndex = 10
Top = 870
Width = 720
End
Begin VB.CommandButton Command3
Caption = "追加"
Enabled = 0 'False
Height = 270
Left = 480
TabIndex = 9
Top = 870
Width = 720
End
Begin VB.TextBox Text3
Enabled = 0 'False
Height = 270
Left = 480
TabIndex = 6
Top = 555
Width = 3045
End
Begin VB.TextBox Text2
Enabled = 0 'False
Height = 270
Left = 480
TabIndex = 5
Top = 240
Width = 3045
End
Begin VB.Label Label2
Caption = "譯文"
Enabled = 0 'False
Height = 180
Left = 105
TabIndex = 8
Top = 585
Width = 360
End
Begin VB.Label Label1
Caption = "英文"
Enabled = 0 'False
Height = 180
Left = 105
TabIndex = 7
Top = 270
Width = 360
End
End
Begin VB.Frame Frame1
Caption = "自由朗讀"
Height = 570
Left = 75
TabIndex = 0
Top = 90
Width = 3615
Begin VB.CommandButton Command2
Caption = "清"
Height = 270
Left = 3270
TabIndex = 3
ToolTipText = "或按Del鍵"
Top = 195
Width = 270
End
Begin VB.CommandButton Command1
Caption = "讀"
Height = 270
Left = 2970
TabIndex = 2
ToolTipText = "或按Enter鍵"
Top = 195
Width = 270
End
Begin VB.TextBox Text1
Height = 270
Left = 75
TabIndex = 1
Text = "請(qǐng)輸入欲朗讀的英文句子!"
Top = 195
Width = 2865
End
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "更多功能將在2.0版推出,敬請(qǐng)期待!"
Enabled = 0 'False
Height = 225
Left = 90
TabIndex = 13
Top = 795
Width = 3600
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim txtvoice As New VTxtAuto.VTxtAuto '引用文本發(fā)音引擎
'朗讀用戶輸入的內(nèi)容
Private Sub Command1_Click()
Call testtxt '對(duì)輸入文本進(jìn)行合法性檢查
If Text1.Text = "才不要念它呢,我會(huì)變啞巴的。:-)" Then GoTo mmm
If Text1.Text <> "" Then
txtvoice.Speed = sspeed
On Error Resume Next '發(fā)音出錯(cuò)改向,由用戶處理
txtvoice.Speak Text1.Text, vtxtst_STATEMENT Or vtxtst_QUESTION Or vtxtst_NUMBERS
End If
mmm: Text1.SetFocus
If Err <> 0 Then Text1.Text = "請(qǐng)不要輸入中文或怪異的表達(dá)!": Err.Number = 0
End Sub
'清除文本框中的內(nèi)容
Private Sub Command2_Click()
Text1.Text = ""
Text1.SetFocus
End Sub
Private Sub Form_Load()
'進(jìn)入設(shè)置窗口時(shí)對(duì)發(fā)音引擎進(jìn)行初始化
Set txtvoice = Nothing
txtvoice.Register vbNullString, " "
Form1.Image1.Enabled = False '自助窗口出現(xiàn)時(shí)禁止菜單彈出
Form1.Timer5.Enabled = False '自助時(shí)禁止朗讀時(shí)序
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Image1.Enabled = True '自助窗口退出時(shí)恢復(fù)菜單彈出
Form1.Timer5.Enabled = True '完成自助,恢復(fù)朗讀時(shí)序
Set Form5 = Nothing
End Sub
'將輸入內(nèi)容用提示條顯示完整
Private Sub Text1_Change()
Text1.ToolTipText = Text1.Text
End Sub
'雙擊文本框清除內(nèi)容
Private Sub Text1_DblClick()
Text1.Text = ""
Text1.SetFocus
End Sub
'按下回車鍵時(shí)朗讀
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
'如果文本框內(nèi)有中文則敲任何鍵都先清空
If Text1.Text = "請(qǐng)不要輸入中文或怪異的表達(dá)!" Or Text1.Text = "才不要念它呢,我會(huì)變啞巴的。:-)" Or Text1.Text = "請(qǐng)輸入欲朗讀的英文句子!" Then Text1.Text = ""
If KeyCode = vbKeyReturn Then
Call testtxt '對(duì)輸入文本進(jìn)行合法性檢查
If Text1.Text = "才不要念它呢,我會(huì)變啞巴的。:-)" Then GoTo nnn
If Text1.Text <> "" Then
txtvoice.Speed = sspeed
On Error Resume Next '發(fā)音出錯(cuò)改向,由用戶處理
txtvoice.Speak Text1.Text, vtxtst_STATEMENT Or vtxtst_QUESTION
End If
nnn: Text1.SetFocus
If Err <> 0 Then Text1.Text = "請(qǐng)不要輸入中文或怪異的表達(dá)!": Err.Number = 0
'按DEL鍵清除文本內(nèi)容
ElseIf KeyCode = vbKeyDelete Then Text1.Text = "": Text1.SetFocus
End If
End Sub
'對(duì)輸入文本進(jìn)行合法性檢查子過程
Private Sub testtxt()
On Error Resume Next
If left(Text1.Text, 10) = String(10, left(Text1.Text, 1)) Then '如果連續(xù)10個(gè)相同字符則不念
Text1.Text = "才不要念它呢,我會(huì)變啞巴的。:-)"
If Err <> 0 Then Text1.Text = "請(qǐng)不要輸入中文或怪異的表達(dá)!": Err.Number = 0
End If
End Sub
'避免按回車鍵時(shí)發(fā)出“嘀”聲
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = Asc(vbCr) Then
KeyAscii = 0
End If
End Sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -