0

I tried to add an icon to the title of the messagebox. I researched at web, but I can't find a good answer. How do I add an icon to the title of the messagebox?

Look to this messagebox:

A messagebox picture with an icon at its title

I tried msgbox and messagebox.show but I can't find how to add an icon to the title.

Can someone help me? I am using Visual Basic 2010.

Peter Macej
  • 4,831
  • 22
  • 49
  • Can you show the code you've tried? – Andrew Mortimer Jan 25 '23 at 09:32
  • I tried this: MessageBox.Show("Example Messagebox", "Messagebox", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) but the icon only visible at inside of the messagebox. Is there a way to add the icon to the title? – RunDLL32.exe Jan 25 '23 at 09:44
  • It seems you need TaskDialog class (https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.taskdialog). See https://learn.microsoft.com/sk-sk/windows/win32/controls/task-dialogs-overview for more info. If not available in VS 2010, you can try pinvoke or WindowsAPICodePack, see https://stackoverflow.com/questions/15645592/ – Peter Macej Jan 25 '23 at 11:12

0 Answers0