Referencing a Windows Application Form

  • Thread starter Thread starter Bisley
  • Start date Start date
B

Bisley

I wish to reference call a method contained in my Windows Applications
"main" form, from another class in the same namespace.

Can anyone tell em how to do this please?

TIA

Bisley
 
Bisley said:
I wish to reference call a method contained in my Windows Applications
"main" form, from another class in the same namespace.

Can anyone tell em how to do this please?

TIA

Bisley

What do you mean by "to reference call a method "

If you just want to call a method (with no object) in another class,
the method can be public and static. Then it can be called from
anywhere in the app. If you want the methd to only be visiable to
the namespace make it internal rather then public.

For example

namespace xyz {

public class MyClass {

static public void dosomething() {
//....can only access other static fields here
}
}

public class user {

void update() {

MyClass.dosomething(); // no ojbect needed
}
}



Karl Meissner, Software Consulant,
http://www.meissnersd.com/resume.htm
 
Back
Top