visual basic error sound
2013-11-18, 03:53 AM,
#1
Hello everyone,
can someone tell me how to play error sound as the app opens,

If someone open the app it will make an error sound (like the critical sound) but the program will still work, i need just the code for the sound in the beginning.

thanks.
Reply
2013-11-18, 03:59 AM, (This post was last modified: 2013-11-18, 04:05 AM by Seen.)
#2
Code:
Sub PlaySystemSound()
    My.Computer.Audio.PlaySystemSound(
        System.Media.SystemSounds.Hand)
End Sub

Edit*

"Hand" is the name of the sound you want.

Source: http://msdn.microsoft.com/en-us/library/....100).aspx
Reply
2013-11-18, 04:15 AM,
#3
(2013-11-18, 03:59 AM)Seen Wrote:
Code:
Sub PlaySystemSound()
    My.Computer.Audio.PlaySystemSound(
        System.Media.SystemSounds.Hand)
End Sub

Edit*

"Hand" is the name of the sound you want.

Source: /en-us/library/vstudio/c27he2zs(v=vs.100).aspx
thanks,
but where do i put it in the code?
Reply
2013-11-18, 04:18 AM, (This post was last modified: 2013-11-18, 04:19 AM by Seen.)
#4
(2013-11-18, 04:15 AM)Xtr3m3r Wrote:
(2013-11-18, 03:59 AM)Seen Wrote:
Code:
Sub PlaySystemSound()
    My.Computer.Audio.PlaySystemSound(
        System.Media.SystemSounds.Hand)
End Sub

Edit*

"Hand" is the name of the sound you want.

Source: /en-us/library/vstudio/c27he2zs(v=vs.100).aspx
thanks,
but where do i put it in the code?

Insert a timer into your program, set it to enabled from the options.
Double click it, and put in:

Code:
PlaySystemSound()
Timer1.Stop()

Make sure you change the "Timer1" above to the timers name.

Then paste the below into your coding section.

Code:
Sub PlaySystemSound()
        My.Computer.Audio.PlaySystemSound(
            System.Media.SystemSounds.Hand)
    End Sub

Here's what it should look like:

[Image: 5lsBu.png]

[Image: 5lszk.png]
Latest Thanks - View all

Xtr3m3r(2013-11-18 04:26 AM) 
Reply
2013-11-18, 04:27 AM, (This post was last modified: 2013-11-18, 04:29 AM by Xtr3m3r.)
#5
(2013-11-18, 04:18 AM)Seen Wrote:
(2013-11-18, 04:15 AM)Xtr3m3r Wrote:
(2013-11-18, 03:59 AM)Seen Wrote:
Code:
Sub PlaySystemSound()
    My.Computer.Audio.PlaySystemSound(
        System.Media.SystemSounds.Hand)
End Sub

Edit*

"Hand" is the name of the sound you want.

Source: /en-us/library/vstudio/c27he2zs(v=vs.100).aspx
thanks,
but where do i put it in the code?

Insert a timer into your program, set it to enabled from the options.
Double click it, and put in:

Code:
PlaySystemSound()
Timer1.Stop()

Make sure you change the "Timer1" above to the timers name.

Then paste the below into your coding section.

Code:
Sub PlaySystemSound()
        My.Computer.Audio.PlaySystemSound(
            System.Media.SystemSounds.Hand)
    End Sub

Here's what it should look like:

[img]/5lsBu.png[/img]

[img]/5lszk.png[/img]

wow thank you for the detailed answer!
you've helped me alot!
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Fraudfilter Campaign Setting Error - Urgent Help Needed. intkhab 2 207 2017-08-08, 01:53 PM
Last Post: intkhab
  404 ERROR HELP ASAP. Karrosales 3 284 2017-04-07, 02:10 AM
Last Post: manjeshsingh
  Visual studio/basic miamor 6 287 2017-03-07, 10:37 PM
Last Post: miamor
  Visual Basic Question Daenerys 2 300 2017-02-24, 10:52 PM
Last Post: imonambot
  [SOLVED] INSTAGRAM ERROR: Sorry, something went wrong creating your account. [SOLVED] Kulop 2 652 2017-02-20, 10:39 PM
Last Post: Xaos





About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top