Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
C#
DialogResult dr = MessageBox.Show("Welcome To MessageBox.", "Discard Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (dr = DialogResult.Yes)
{
    this.Close();
}
else
{

}

I want to change the Text Property of YesNo Buttons.

Any idea, please let me know.

Regards,
Pawan.
Posted
Updated 8-Mar-10 2:30am
v2

You have to create your own custom message box to achieve this functionality.

If you look at the MessageBox class, and the methods/properties associated:
MSDN: Message Box[^]
The functionality asked by you is not provided.
 
Share this answer
 
The MessageBox is a system dialogue and and cannot be manipulated directly.

In order to customise the MessageBox you will have to create your own Form that duplicates the functionality. You can then manipulate it to your heart's content.
 
Share this answer
 
You could use the technique[^]
to reset the buttons text (SetDlgItemText()) in the hooks procedure :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900