it’s possible?
based in another’s examples, as LabelExtesios, StringExtensions, etc.
I wrote this:
namespace MessageBoxExtensions
{
public static class MessageBoxExtensionsClass
{
public static void Foo()
{
}
}
}
then:
using MessageBoxExtensions;
// ...
MessageBox.Foo();
gin an error: MessageBox.Foo();
'System.Windows.Forms.MessageBox' does not contain a definition for 'Foo'
Description
You cant do this because
System.Windows.Forms.MessageBoxis NOT an instance ofMessageBox.MessageBox.Show()is a static method.You cant create an instance of
MessageBoxbecause this class has no public constructor.Update
But you can create your own class in the
System.Windows.Formsnamespace and use theMessageBoxin this method like thisSample