By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,992 Members | 1,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,992 IT Pros & Developers. It's quick & easy.

Beep in c#

P: n/a
I'm a vb guy learning c#. What's the equivalent of the vb beep function in
c#?

--
mo*******@nospam.nospam
Apr 3 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
moondaddy,

You could always set a reference to Microsoft.VisualBasic.dll, and then
call the static Beep method on the Interaction class in the
Microsoft.VisualBasic namespace.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"moondaddy" <mo*******@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I'm a vb guy learning c#. What's the equivalent of the vb beep function
in c#?

--
mo*******@nospam.nospam

Apr 3 '06 #2

P: n/a
"moondaddy" <mo*******@nospam.nospam> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I'm a vb guy learning c#. What's the equivalent of the vb beep function
in c#?


http://blogs.msdn.com/brada/archive/...03/148142.aspx
Apr 3 '06 #3

P: n/a
moondaddy wrote:
I'm a vb guy learning c#. What's the equivalent of the vb beep function in
c#?


If you are writing a console app, you could use this:

Console.Beep()
Apr 3 '06 #4

P: n/a
Use the SystemSounds, as in:

public void onePing()
{
SystemSounds.Beep.Play();
}This is new in v 2.0 of C#"moondaddy" <mo*******@nospam.nospam> wrote in
message news:%2****************@TK2MSFTNGP14.phx.gbl...
I'm a vb guy learning c#. What's the equivalent of the vb beep function
in c#?

--
mo*******@nospam.nospam

Apr 3 '06 #5

P: n/a


SystemSounds.Beep.Play();
Apr 4 '06 #6

P: n/a
You can also use that in a Windows Forms App:

System.Console.Beep(250, 500);

Apr 4 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.