用api吧
先在Public Class Form1后声明一下:
Public Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Integer, ByVal dwDuration As Integer) As Integer
在需要时调用:
beep(100,100)
可以通过两个参数改变频率和时间
我以前也用过.net里的beep,但一直没找出为什么不好用,这个api绝对好用,强烈建议楼主使用
调用API可以精确控制PC喇叭的。
Public Declare Function Beep Lib "kernel32" Alias "Beep" (ByVal dwFreq As Integer, ByVal dwDuration As Integer) As Integer
前一个值是频率,后一个值是持续时间。