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
Printable View
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
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.
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.
thanks. Can MS not give us a bingless messagebox ??
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.
Thanks very much. I do believe I have also seen something similar at codeproject
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.
That was my next point. I need to use icons and get that baby to flash :)
microsoft provides a lot of fantastic tools......but bingless messageboxes are not one of them!!
good luck with your flashy messagebox:)
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
you need to pass the window's .handle property, and true as the params to this function, and it will flash the window.Code:<DllImport("user32.dll")> _
Private Shared Function FlashWindow(ByVal hwnd As IntPtr, ByVal bInvert As Boolean) As Boolean
End Function
Heres how you can link to the system icons for a messagebox.
http://www.vbforums.com/showthread.php?t=266529
or that :DQuote:
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.Quote:
Originally Posted by klienma
Linking to the system icons is th best and safest way.
due to licensing or actual restriction?Quote:
Originally Posted by RobDog888
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'
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:
And each icon then has its description of what it represents.Quote:
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:
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.
so true :(Quote:
Originally Posted by RobDog888
usually expensive as well as confusing and overlycomplicated!
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 :lol:
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.
Isnt that the point though? They just 'mimic' the icons, they dont use the exact MS ones (?)
No they dont. they use "similar" icons to get around licensing..