Results 1 to 22 of 22

Thread: [2008] Messagebox.show without beep

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    [2008] Messagebox.show without beep

    I need a silent messagebox.show without the beep bing.

    Is there any way to silence it or can someone please point me to some code ?

    Thanks

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2008] Messagebox.show without beep

    no, but you can create your own messagebox as a form.

    When I do that, so I don't have to worry about resizing everything to fit the text I want, I usually just use a multiline textbox with readonly set to true and give it scrollbars.

  3. #3
    Lively Member
    Join Date
    Jul 2008
    Posts
    89

    Re: [2008] Messagebox.show without beep

    Yep, that's the only way I know how to do it too. A read-only textbox is nice too because the user's can select and copy the text from the message box....and of course the text wraps automatically, unlike the default messagebox.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    Re: [2008] Messagebox.show without beep

    thanks. Can MS not give us a bingless messagebox ??

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2008] Messagebox.show without beep

    Well the messagebox has been around since the dawn of Windows, and not a ton has changed with it. If you look up the documentation for the actual Win32 API call to the Messagebox function (it is in the User32.dll library) you can look at all the possible flags, and none of them have to do with beeping or not beeping. If the Win32 function had the ability, but it just wasn't rolled into the framework, you could still do it, however it is not the framework that makes the beep happen, it is the actual Win32 function.

    I did notice there is also a MessageBoxEx function which states (currently has the same functionality as messagebox) which means they likely added it now for future use, when they expand on the messagebox's capabilities.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    Re: [2008] Messagebox.show without beep

    Thanks very much. I do believe I have also seen something similar at codeproject

  7. #7
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2008] Messagebox.show without beep

    To be honest, the best part about making it yourself, is that you can be a little more creative. Maybe you want a different image than the small handful of stock ones the messagebox class can use, or maybe you want the buttons to say something other than the few default button text values you can set. Maybe you want a hyper link on the messagebox. etc....

    You see what I am saying though, you have much more freedom when you make your own.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    Re: [2008] Messagebox.show without beep

    That was my next point. I need to use icons and get that baby to flash

  9. #9
    Lively Member
    Join Date
    Jul 2008
    Posts
    89

    Re: [2008] Messagebox.show without beep

    microsoft provides a lot of fantastic tools......but bingless messageboxes are not one of them!!

    good luck with your flashy messagebox

  10. #10
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2008] Messagebox.show without beep

    the icons are stock art that ship with visual studio.

    For VS 2008, the SHOULD be in a zip file located here:
    C:\Program Files\Microsoft Visual Studio 9.0\Common7\VS2008ImageLibrary\1033

    Specifically in the zip file under

    VS2008ImageLibrary\Annotations&Buttons\ico_format\WinXP

    you will find the stock Windows messagebox icons

    You could even use the Vista ones if you wanted.

    There are tons of other good graphics in many formats in that zip file.

    Getting a window to flash is really simple using the FlashWindow api call

    Code:
    <DllImport("user32.dll")> _ 
    Private Shared Function FlashWindow(ByVal hwnd As IntPtr, ByVal bInvert As Boolean) As Boolean 
    End Function
    you need to pass the window's .handle property, and true as the params to this function, and it will flash the window.

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2008] Messagebox.show without beep

    Heres how you can link to the system icons for a messagebox.
    http://www.vbforums.com/showthread.php?t=266529
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2008] Messagebox.show without beep

    Quote Originally Posted by RobDog888
    Heres how you can link to the system icons for a messagebox.
    http://www.vbforums.com/showthread.php?t=266529
    or that

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2008] Messagebox.show without beep

    Quote Originally Posted by klienma
    You could even use the Vista ones if you wanted.
    You could use them on a system with Vista but you can not use them on XP or 2000 Pro etc.

    Linking to the system icons is th best and safest way.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2008] Messagebox.show without beep

    Quote Originally Posted by RobDog888
    You could use them on a system with Vista but you can not use them on XP or 2000 Pro etc.

    Linking to the system icons is th best and safest way.
    due to licensing or actual restriction?

  15. #15
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2008] Messagebox.show without beep

    Licensing I believe. When I was building my XP Panel control I was researching about redistributing the XP icons to other OS' and it was found to be against the license. Guess if they dont have XP then they cant use certain icons. This is why you wont find exact icon packs of the various OS'
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  16. #16
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2008] Messagebox.show without beep

    The icon libraries come with readme files, and the readme file has a Use Restrictions section. It doesn't say anything about the target OS for usage, it actually states that the icons simply need to be used for whatever MS says the icons should be used for, as in "you can only use the error icon when you are using it to notify of an error" etc.

    The exact wording is:

    As part of a visual language, the following images (or any part of the images) must be used in a manner consistent with the description indicated below:
    And each icon then has its description of what it represents.

  17. #17
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2008] Messagebox.show without beep

    Well that just states the icon should be used for what its meant to be used for and nothing about redistrbuting it. Licensing is always confusing and overlycomplicated. Linking guarentees you are using their icon(s) and no need to redistribute anything = safer.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  18. #18
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [2008] Messagebox.show without beep

    Quote Originally Posted by RobDog888
    Licensing is always confusing and overlycomplicated.
    so true
    usually expensive as well as confusing and overlycomplicated!
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  19. #19
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2008] Messagebox.show without beep

    I figure that if you can do it with linking its safer and for what with equal amount of difficulity/code why not. Its better then getting involved in some kind of MS litigation
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  20. #20
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2008] Messagebox.show without beep

    I do agree linking is the better route because you use the icons that are familiar to the OS, and likely that the user will recognize. If they are running 98, and you use some Vista icon, it may not provide the same visual assistance.

    That being said though, I am going to look into the licensing implications with icons from one MS operating system to the next.

    Being that there are apps out there that visually mimic Vista's UI and glass features on machines running XP, I have to feel that it is safe to be using some Vista icons in XP.

  21. #21
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [2008] Messagebox.show without beep

    Isnt that the point though? They just 'mimic' the icons, they dont use the exact MS ones (?)
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  22. #22
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2008] Messagebox.show without beep

    No they dont. they use "similar" icons to get around licensing..
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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