markgoldin <ma*************@yahoo.comwrote:
I am trying to get something like this working:
public class classA
{
// Here I want to do something with GetMessage form:
Form f = new getMessage.GetMessage();
f.Show();
does not work. Can that be actually done? Can I work with GetMesasge
form here?
}
Well, there are a few problems here:
1) There's no such class as getMessage.GetMessage - there's
classB.GetMessage though
2) You're trying to write code directly into a class - aside from
variable initializers, code goes in methods (and properties etc).
If you change your code to:
public class classA
{
void SomeMethod()
{
// Here I want to do something with GetMessage form:
Form f = new classB.GetMessage();
f.Show();
}
}
then it will compile. Of course, you've then got to call SomeMethod...
--
Jon Skeet - <sk***@pobox.com>
Web site:
http://www.pobox.com/~skeet
Blog:
http://www.msmvps.com/jon.skeet
C# in Depth:
http://csharpindepth.com