I am trying to inherit from MessageBox and i get error in
compilation time.
The code is:
public class MyMessageBox : MessageBox
{
public static DialogResult Show(int errorCode)
{
return DialogResult.OK ;
}
}
The error is:
System.Windows. Forms.MessageBo x.MessageBox() is
inaccessible due to its protection level
I guess it because the constructor of MessageBox is privte.
My question is, is there anyway to inherit from messagebox?
Thanks,
Adam
compilation time.
The code is:
public class MyMessageBox : MessageBox
{
public static DialogResult Show(int errorCode)
{
return DialogResult.OK ;
}
}
The error is:
System.Windows. Forms.MessageBo x.MessageBox() is
inaccessible due to its protection level
I guess it because the constructor of MessageBox is privte.
My question is, is there anyway to inherit from messagebox?
Thanks,
Adam
Comment