Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change MessageBox Title used by MM dialogs?
Message
 
 
À
22/03/2006 15:39:39
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01106727
Message ID:
01106786
Vues:
22
Hi Mark,

Thanks for your reply

I tried a slight change to what you suggested, but it doesnt seem to work - I even put breakpoints on each of the lines (even on an override of CreateMessageBoxForm() and the breakpoints were never hit):
	public override OakLeaf.MM.Main.Windows.Forms.mmMessageBoxForm CreateMessageBoxForm(string message, string caption, System.Windows.Forms.MessageBoxButtons buttons, object languagePK)
		{
			return base.CreateMessageBoxForm (message, "Test", buttons, languagePK);
		}

		public override OakLeaf.MM.Main.Windows.Forms.mmMessageBoxForm CreateMessageBoxForm(string message, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, object languagePK)
		{
			return base.CreateMessageBoxForm (message, "Test", buttons, icon, languagePK);
		}

		public override OakLeaf.MM.Main.Windows.Forms.mmMessageBoxForm CreateMessageBoxForm(string message, string caption, System.Windows.Forms.MessageBoxButtons buttons, System.Windows.Forms.MessageBoxIcon icon, System.Windows.Forms.MessageBoxDefaultButton defaultButton, object languagePK)
		{
			return base.CreateMessageBoxForm (message, "Test", buttons, icon, defaultButton, languagePK);
		}
>You can override the factory method that is used to create the mmMessageBoxForm object. There are actually three overrides for this method you may want change (you can look at mmFactoryDesktop.cs for all the methods).
>
>I believe for this particular message add this to your factory.cs.
>
>using System.Windows.Forms;
>using OakLeaf.MM.Main.Windows.Forms;
>
>public class Factory : OakLeaf.MM.Main.Windows.Forms.mmFactoryDesktop
>{
>
>public override mmMessageBoxForm CreateMessageBoxForm(string message, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, object languagePK)
>{
> // override the caption here...
> return new mmMessageBoxForm(message, "Your Caption Here",
> buttons, icon, languagePK);
>}
>
>
>
>
>>When I close a form and get the messagebox asking whether to save changes, the title of the MessageBox is "Application Message" - where can I override that text?
>>
>>Note for lurkers, I know how to change the title of a messagebox, I'm asking for how to override the caption in the messagebox that MM uses by default in its framework
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform