General information
Category:
The Mere Mortals .NET Framework
Hello All:
We're trying to subclass mmMessageBox so that we can change the color to match our color scheme. We have created zzMessageBox, zzMessageBoxForm, zzAppDesktop and zzFactoryDesktop.
In zzAppDesktop, we have created the following method:
public override mmMessageBox MessageBox
{
get
{
// Instantiate the MessageBox object if it's null
if (_messagebox == null)
{
zzFactoryDesktop WinFactory = (zzFactoryDesktop)Factory; //error here
_messagebox = WinFactory.CreateMessageBox();
}
return _messagebox;
}
set { _messagebox = value; }
}
private static zzMessageBox _messagebox;
This method calls our zzFactoryDesktop, which has the follwing method:
public new zzMessageBox CreateMessageBox()
{
return new zzMessageBox();
}
However, this does not work. We are getting an error on the line I have noted, saying the specified cast is not valid. First off, can mmMessageBox be subclassed to change properties such as color, font, etc...? Second, are we going about this the correct way? If we are not doing it properly, how should this be done?
Thanks for any advice!
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only