Writing a winforms application. I have created a yes/no message box, displayed to the user when they are trying to delete a file but I would like to add the recycle bin image to the message. How do you get access, for use with things like message boxes systems icons/images?
MessageBox.Show("Please confirm that you would like to delete the folder named:" + fldnme,
"Confirm Folder Delete",
MessageBoxButtons.YesNo,
MessageBoxIcon.Exclamation);
Obviously I would be replacing the messageboxicon with?
Thanks
Short answer: you cannot.
The Win32 MessageBox window only lets you choose one of four icons (the other members of MessageBoxIcon
are synonyms) that corresponds to the purpose of a messagebox:
In your use-case, to ask the user to confirm the deletion of a file, you should use either the Question-mark icon or the Warning triangle icon.
I'm going to assume that you call File.Delete
if the user selects Yes rather than moving the file to the Recycle Bin. If this is the case then you really shouldn't use the Recycle Bin icon (even if you could) because you aren't moving it to the bin, you're deleting it straight away.