roger_27 wrote:
in C# you need to make an instance first. like this
Form1 formy = new Form1();
formy.publicmethod("hello world");
once you press "." for your instance, you will see the method.
Yes, he will. But it won't be the instance he wants.
Tom, the above reply is half-right anyway: you do need an instance of
your form class to get at the instance method. The solution is either
to somehow get that instance to the event handler, or to make the method
a static method.
If the method does not actually need access to any instance data from
the form instance you have, then the latter is probably the easiest
thing to do.
If you can't make the method static, but you are still having trouble
figuring out how to get the instance to the event handler, please post a
more complete description of how the two forms are related so that more
specific advice can be given.
Pete