Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WinForm
Hello guys,
 
My question is really simple I want to change the text on messagebox buttons to something else
 
for example I want to make 'yes' button say 'sure'
 
can I do this ?
 
I did google this some while ago and I remember I couldnt find anything helpful so if somebody get me a google result it will be Embarrassing Smile | :)
 

thanks in advance
Smile | :)
Posted 13-Apr-11 23:18pm
a1mimo1.7K
Comments
Tarun.K.S at 14-Apr-11 4:24am
   
I am not sure whether that's possible but you can make a custom window for it.
SAKryukov at 14-Apr-11 22:51pm
   
That would much more appropriate thing to do (not for the novice by the way), compared to the method based on Hook, even though it's quite creative.
--SA
a1mimo at 14-Apr-11 4:32am
   
I know that, but its just I am too lazy and curious about it :-)
Thank you,
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

It is indeed possible.
There is a ready made class for this, here on CodeProject.
Just use the CodeProject Search feature!
Good luck!
 
If you really can't find it... try here: Localizing System MessageBox[^]
  Permalink  
v2
Comments
a1mimo at 14-Apr-11 5:01am
   
Thank you Toli
I actually tried your advice and I was just reading it, you are a big help :-)
Tarun.K.S at 14-Apr-11 5:56am
   
Wow so it works!
girish sp at 14-Apr-11 7:04am
   
toli-i thought its not possible..easy way to do..good answer!!my 5
SAKryukov at 14-Apr-11 22:49pm
   
Great article (my 5 for the reference), great illustration of "Windows must die". Created absolutely inflexible MessageBox, but the Hook beats it.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I believe calling Win32 API is only one way how to achieve this. If I remember correctly this could be done by using SendMessage API function. But it needs to know handle of the "window"(button) intended for caption change.
  Permalink  
Comments
a1mimo at 14-Apr-11 4:34am
   
can you suggest me an article or something to do so? I would appreciate this
Thank you,
Rampas Tomas at 14-Apr-11 4:39am
   
I found it just 2 clicks from here :)
 
http://www.codeproject.com/KB/cpp/dMsgBox.aspx
a1mimo at 14-Apr-11 5:00am
   
Thanks Rampas
I got it I appreciate your help :-)
girish sp at 14-Apr-11 7:04am
   
my 5!!

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 390
1 OriginalGriff 205
2 Zoltán Zörgő 124
3 Dave Kreskowiak 120
4 BillWoodruff 110
0 OriginalGriff 7,610
1 DamithSL 5,559
2 Sergey Alexandrovich Kryukov 5,324
3 Maciej Los 4,961
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 14 Apr 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100