T
Typpo
Hi,
This question is somewhat basic. Is it possible to call a method in
frmMain, using another class? Here's a snippet:
partial class frmMain : Form
{
private void MessageThis(String text)
{
MessageBox.Show(text);
}
}
public class AnotherClass
{
public AnotherClass(text)
{
frmMain.MessageThis(text); //doesn't work
MessageThis(text); //doesn't work
//and so on...
}
}
I've dabbled with public and static methods, etc, but I can't seem to
find the correct way.
Thanks.
This question is somewhat basic. Is it possible to call a method in
frmMain, using another class? Here's a snippet:
partial class frmMain : Form
{
private void MessageThis(String text)
{
MessageBox.Show(text);
}
}
public class AnotherClass
{
public AnotherClass(text)
{
frmMain.MessageThis(text); //doesn't work
MessageThis(text); //doesn't work
//and so on...
}
}
I've dabbled with public and static methods, etc, but I can't seem to
find the correct way.
Thanks.