MsgBox("对不起,不能播放此语音文件", MsgBoxStyle.OkOnly, "PC复读机")
Exit Sub
End Try
Dim StartPoint As Single = 0.0
Dim EndPoint As Single = 0.00001
Dim s1, m1 As Integer
Dim d1 As Single
m1 = d1 \ 60 : s1 = d1 Mod 60
LbStart.Text = Format(m1, "00") & ";" & Format(s1, "00.0")
Dim s2, m2 As Integer
m2 = EndPoint \ 60 : s2 = EndPoint Mod 60
LbEnd.Text = Format(m2, "00") & ":" & Format(s2, "00.0")
TkProgress.Minimum = 0
TkProgress.Maximum = AxWindowsMediaPlayer1.currentMedia.duration
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
其余菜单代码只需执行相应按钮对应的PerformClick事件。
(11)窗体的初始化代码
Private Sub Form1_Load1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
LbStart.Text = "开始点"
LbEnd.Text = "结束点"
LbStop.Enabled = "false"
LbPause.Enabled = "false"
End Sub
5 运行结果
如图6所示。
图1
6 结语
以上程序在Windows XP+VB.NET 2008运行通过。这中间有许多值得注意的技术细节,比如在读取听写记录时,就需要设置.Encoding.Default为默认参数,否则中文显示会出现乱码。动画显示,计数器中一些代码也都需要留心。
参考文献
[1] Beginning VB 2008 From Novice to Professional. Christian Gross . Apress.2008.
[2 ]Microsoft Visual Studio 2005文档.
|