By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,458 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,458 IT Pros & Developers. It's quick & easy.

Referencing a Windows Application Form

P: n/a
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
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can pass a reference of the main form to the other class ...

- Shardool

"Bisley" <x> wrote in message news:ei**************@TK2MSFTNGP09.phx.gbl...
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

Nov 15 '05 #2

P: n/a
"Bisley" <x> wrote in message news:<ei**************@TK2MSFTNGP09.phx.gbl>...
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
Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.