Results 1 to 21 of 21

Thread: How to disable MsgBox sound

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    111

    Wink How to disable MsgBox sound

    A way to disable this sound or disable any sound in my App?

    Code:
    [blue]
    If Not IsNumeric(txtSampleNum) Then
        MsgBox "Only Integers.", ,""
        Exit Sub
    End If
    [/blue]

  2. #2
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: How to disable MsgBox sound

    The easiest way is to use the Question Mark icon, it doesn;t have a sound set to it.
    Code:
    Call MsgBox("asd", vbQuestion, App.Title)
    Or you could use the msg box in my sig and disable the sound section

  3. #3
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: How to disable MsgBox sound

    The user could always have set a sound for the Question msgbox though in control panel. The custom form is probably the best way to go. The sound is a Windows thing and you'd have to mute the system sound which a user may not like.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Posts
    111

    Re: How to disable MsgBox sound

    Yes maybe a custom form message is the way to go.
    Attached Images Attached Images  

  5. #5
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: How to disable MsgBox sound

    Quote Originally Posted by CVDpr
    A way to disable this sound or disable any sound in my App?

    Code:
    [blue]
    If Not IsNumeric(txtSampleNum) Then
        MsgBox "Only Integers.", ,""
        Exit Sub
    End If
    [/blue]
    Well that shouldn't use any sounds because your using no icon.

    These sounds are set by Windows. If you look in Control Panel - Sounds or Multimedia you can set different sounds for different operations. There is a Question sound longwolf so vbQuestion will only be silent if someone hasn't set a sound to it.

    The ones that don't use sounds are vbExclamation and vbInformation. There is an Exclamation in sounds but it doesn't sound using vbExclamation.

    Even if you use MsgBox "Only Integers.",0 ,"" zero is just an OK button with no icon. If you have a sound set for Default sound then that sound will play.

    If you don't want any sounds at all then your better of making a Form that acts as a MsgBox.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  6. #6
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: How to disable MsgBox sound

    Quote Originally Posted by CVDpr
    A way to disable this sound or disable any sound in my App?

    Code:
    [blue]
    If Not IsNumeric(txtSampleNum) Then
        MsgBox "Only Integers.", ,""
        Exit Sub
    End If
    [/blue]
    Well that shouldn't use any sounds because your using no icon.

    These sounds are set by Windows. If you look in Control Panel - Sounds or Multimedia you can set different sounds for different operations. There is a Question sound longwolf so vbQuestion will only be silent if someone hasn't set a sound to it.

    The ones that don't use sounds are vbExclamation and vbInformation. There is an Exclamation in sounds but it doesn't sound using vbExclamation.

    Even if you use MsgBox "Only Integers.",0 ,"" zero is just an OK button with no icon. If you have a sound set for Default sound then that sound will play.

    If you don't want any sounds at all then your better of making a Form that acts as a MsgBox.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  7. #7
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: How to disable MsgBox sound

    Thanks for repeating everything that was already said. and exclamation DOES have a sound. As does the MsgBox he's using.

  8. #8
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: How to disable MsgBox sound

    Quote Originally Posted by Keithuk
    There is a Question sound longwolf so vbQuestion will only be silent if someone hasn't set a sound to it.

    The ones that don't use sounds are vbExclamation and vbInformation. There is an Exclamation in sounds but it doesn't sound using vbExclamation.
    I have XP and have not changed the sounds.
    I get no sound with the question.
    I get sounds with the rest.
    Even No Icon gives a Donk.

    But that just makes the point that the surest method is a custom msg box.

  9. #9
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: How to disable MsgBox sound

    Quote Originally Posted by danecook21
    Thanks for repeating everything that was already said. and exclamation DOES have a sound. As does the MsgBox he's using.
    Yes I realised after I had posted that MsgBox "Only Integers.", ,"" would still have a sound because someone had set a sound to Default sound which I had said. I tried to correct it but my connection was working that slow it wouldn't allow me.

    Quote Originally Posted by longwolf
    I have XP and have not changed the sounds.
    I get no sound with the question.
    I get sounds with the rest.
    Even No Icon gives a Donk.
    Well I have Win98SE I haven't had a chance of trying this on WinXP yet.

    I get a sound if I set a sound to Question. I don't get a Donk even with no icon unless I set a sound to Default sound.

    Quote Originally Posted by longwolf

    I get no sound with the question.

    The easiest way is to use the Question Mark icon, it doesn;t have a sound set to it.
    Yes vbQuestion will sound if a sound it set to it.

    Just make your own MsgBox Form.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  10. #10
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: How to disable MsgBox sound

    In most cases there is going to be a sound for Default. Why are you on Win98 anyway? :P

  11. #11
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: How to disable MsgBox sound

    Quote Originally Posted by danecook21
    Why are you on Win98 anyway? :P
    I stayed with win98 till I finally managed to blow out my old comp.
    Why pay for (or steal) a new OS when the old one works for you?

  12. #12
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: How to disable MsgBox sound

    Quote Originally Posted by danecook21
    In most cases there is going to be a sound for Default. Why are you on Win98 anyway? :P
    That's about as pointless as me asking why you're using VB6.
    After all, they were both developed about the same time.
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  13. #13
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: How to disable MsgBox sound

    Quote Originally Posted by CDRIVE
    That's about as pointless as me asking why you're using VB6.
    Not really, VB6 is just a development tool. Windows 98 is the operating system and it is very limiting. XP is so much better. and of course now there is Vista and Windows 7 in the works.
    I mean if it works for you great. I'm just surprised that a developer on here still uses it for a primary system. I mean one huge thing would be security. Plus newer software tends not to work with it.

  14. #14
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: How to disable MsgBox sound

    I'm not aware of any limitation your talking about.
    As for security, the only secure system has no nic or modem, is locked in a bank vault and surrounded by guards.
    Come to think of it, i'm not sure you could trust the guards.

  15. #15
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: How to disable MsgBox sound

    Quote Originally Posted by danecook21
    In most cases there is going to be a sound for Default. Why are you on Win98 anyway? :P
    I think the real point is that different operating systems have different behaviors. If one is writing code that can be used on older operating systems, then knowing the behaviors is a big plus. I personally have the following systems on my pc: 95, 98, ME, NT4, 2K, XP. Vista can wait
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  16. #16
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: How to disable MsgBox sound

    Quote Originally Posted by LaVolpe
    I personally have the following systems on my pc: 95, 98, ME, NT4, 2K, XP. Vista can wait
    You got all of those on one comp?
    You must be sharing partitions.

  17. #17
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: How to disable MsgBox sound

    Quote Originally Posted by longwolf
    You got all of those on one comp?
    You must be sharing partitions.
    Nope. Using Microsoft's free Virtual PC. But you gotta have the installation disks to the other o/s you want to load -- Win95 was a bear, but the rest were easy enough.

    Edited: While typing this, I am currently updating Win2K with several patches from Microsoft, even though my primary/running system is XP.
    Last edited by LaVolpe; Nov 7th, 2008 at 10:35 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  18. #18
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: How to disable MsgBox sound

    VPC is handy, but I only use it because this cheap laptop won't let me make partitions

  19. #19
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: How to disable MsgBox sound

    Quote Originally Posted by danecook21
    In most cases there is going to be a sound for Default. Why are you on Win98 anyway? :P
    Don't ask this is a long story.

    I've actually had another hard drive this week and its taken seven attempts to get WinXP to install. Otherwise I get loads of blue screen errors and it crashes.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

  20. #20
    PowerPoster CDRIVE's Avatar
    Join Date
    Jul 2007
    Posts
    2,620

    Re: How to disable MsgBox sound

    Quote Originally Posted by Keithuk
    Don't ask this is a long story.

    I've actually had another hard drive this week and its taken seven attempts to get WinXP to install. Otherwise I get loads of blue screen errors and it crashes.
    Keith, is it possible that the problem is with XP not working well with the
    W98 BIOS chip?
    <--- Did someone help you? Please rate their post. The little green squares make us feel really smart!
    If topic has been resolved, please pull down the Thread Tools & mark it Resolved.


    Is VB consuming your life, and is that a bad thing??

  21. #21
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236

    Re: How to disable MsgBox sound

    Quote Originally Posted by CDRIVE
    Keith, is it possible that the problem is with XP not working well with the
    W98 BIOS chip?
    I'm afraid not Chris. I bought WinXP 2002 4 years ago and installed it on my old hard drive without a problem. I bought a new hard drive a couple of years ago and it wouldn't install at all, the BIOS is exactly the same Award 4.60PGA. I had another drive last week and that kept on throwing up the blue screen of death errors. I kept on trying different thing then I decided when it asks if you want to do a full NTFS format which I did but after the format got to 100% I get the error again and there is nothing wrong with the drive. So I went for a Quick format I went for quick and it started to install.

    I know this isn't a VB problem so I'm sorry if I keep talking about it, but people ask.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width