473,498 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing a Windows Application Form

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
2 1199
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1229
by: Walter G | last post by:
I have a VB.Net application that can be executed with parameters. If parameters are received, the I execute a function that will open a form within the application. On top of that, I'd like to...
4
2615
by: Jelmer | last post by:
Hi I've been trying to create an addin similar to Find & Replace from Rick Fisher that looks thru your tables / queries / forms / modules etc.. for a reference to a string and optionally let's you...
7
6172
by: Dave | last post by:
I have two forms, Form1 and Form2. From Form2, how do I reference the value in a control on Form1? Or perhaps a more specific question: Form1 contains a textbox with the value of 10. This form...
6
1080
by: Christopher Weaver | last post by:
This is a broad question. I am developing a multiform Windows applications. There is only one database involved. I would like to establish one connection object and a few DataAdapters and...
2
2886
by: Steve | last post by:
I have a .NET windows program that has a VB.NET component and a C# component. The VB component contains the form and handles all the UI stuff. The C# component drives the engine that actually does...
6
3419
by: Ken Breit | last post by:
I have an ActiveX control that I would like to make available from any form in my application. I figured the best way was to create a reference to it, and then have a module that will create the...
7
5782
by: Russ Green | last post by:
I am currently developing an application in VB.NET that uses the Microstation's object model via COM Interop. I have a problem regarding multiple instances of the Microstation application...
1
1157
by: Maart_newbie | last post by:
Hi all, I have a an instance of a form, lets say Form2, that is constructed from within a event handler of an instance of Form1, subsequently I call ShowDialog with the instance of Form1 as its...
2
1130
by: Milsnips | last post by:
Hi there, i have a test application with 2 forms - frmMain and frmDialog the application starts with frmMain (which has a label on it called lblStatus), and when i click a button, it opens the...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.