473,808 Members | 2,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Beep sound when error occurs using C#

10 New Member
Hai iam working on a project were i have some textboxes in that one textbox should allow only digits from 0 to 360 and for that i have a error provider when i enter 361 the error provider blinks i need a beep sound when that error provider blinks how can i get this beep sound plz any one help me in this
Jan 5 '08 #1
3 3886
CyberSoftHari
487 Recognized Expert Contributor
Expand|Select|Wrap|Line Numbers
  1. [DllImport("coredll.dll")]
  2.         public static extern int PlaySound(
  3.             string szSound,
  4.             IntPtr hModule,
  5.             int flags);
you can import the above dll to play beep. What version of .Net version you are using.
Jan 5 '08 #2
ramya naidu
10 New Member
Iam not using .net iam using visual studio c# express so can u help me plz
Jan 5 '08 #3
CyberSoftHari
487 Recognized Expert Contributor
I think you are not good in basics.

Expand|Select|Wrap|Line Numbers
  1. [DllImport("kernel32.dll")]
  2.     public static extern bool Beep(int freq,int duration);
Jan 5 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
8763
by: bill_m | last post by:
Has anyone tried to use the .NET Beep function? The following works in VBA: Private Declare Function Beep Lib "Kernel32.dll" _ (ByVal X As Long, ByVal Y As Long) As Long Dim blVal As Boolean Dim dwFreq As Long Dim dwDuration As Long
19
56730
by: Anon Email | last post by:
Hi everyone, Let's see, now. This question is about the capabilities of ANSI C++. I want to write and compile code in ANSI C++ that, when compiled, will make the computer speaker beep; or, at least, SHOULD make the computer speaker beep. I know that whether the computer speaker actually beeps or not is largely dependent on the OS I'm using. But I'm not so much concerned about that (at this stage). I just want to know if ANSI C++...
4
1796
by: mrw | last post by:
I was wondering how you create that default error beep that you dear when say you go to start, then run, and type in a bad filename. You here a specific sound. It must be some type of API or something, right? Since that sound can be changed to whatever you want and the new sound will still play. That to me tells me that it isn't just code that plays a sound but some API call to the "Asterisk" sound which then points to the whatever...
2
2311
by: Ivo | last post by:
In an Win/IE-only application, some checkboxes and the like have been assigned accesskeys, so pressing alt+w focuses a checkbox, alt+b another. This is very convenient. However, when the checkboxes are hidden, for example because they are in a div styled "display:none", pressing the magic key combination does not work of course, but instead Windows generates an warning beep, a sound. Now I have written a function that will toggle the...
3
2902
by: Thom Little | last post by:
The following code will produce a sound in C# ... using System.Runtime.InteropServices; Beep( 500, 500 ); private static extern bool Beep( int freq, int dur ); How can I play the sound associated with the System "Default Beep"?
5
15191
by: John Lee | last post by:
Hi, It's anoying each time the computer beeps when MessageBox.Show() popsup - I turned off all sound in control panel - audio setting but it still beeps. Can anyone help? Thanks! John
7
2447
by: Arne | last post by:
I have noticed that my customer doesn't always read error my error messages. How can I create a beep in the browser?
2
20237
by: Simon Wigzell | last post by:
I have replaced all of my form checking alerts with a javascript routine that writes the error message into the form above the field where the error occurs. I would like it to make a similar noise to the alert box though. Is there a javascript command to make this noise? I do not want to be playing a sound file from the server, just using the local client resources as the alert does. Any idea how to do this? I cannot find anything...
4
9957
by: =?Utf-8?B?UmljaA==?= | last post by:
When I press the Enter key in a Textbox I get a beep sound. But when I press the Enter key in a combobox, I don't get the beep sound. Is there a way to suppress the beep? How to do this? Thanks
0
9600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10374
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9195
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5547
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.