473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Sharing references/members

..Net 2003 V- 7.1.3088
Framework 1.1 V- 1.1.4322 SP1
WinXp SP2

I'm building a WinForms project and I have 3 levels of
forms( the MDI Form, a MDI child form, and a modal form
called from the MDI child form ). I have a member
declared in the MDI Form that I need to be able to
manipulate from within the other two forms and I'm not
sure of the best way to go about this ( I'm used to
ASP.net, where I would simply put this in the Session
object and call it from each page ). Can anyone point me
in the right direction here? Thanks!!!

Tom S.
Nov 21 '05 #1
2 849
Tom,

Create a new property for your MDI form that exposes the object you require.

Then, from the child form:

----
Me.MdiParent.YourProperty.SomeMethod()
----

For the modal form to access the property you need to pass a reference
to the MDI parent somehow. I personally suggest passing the reference as
an argument to the modal form's constructor.

Regards,
-Adam.

Tom S. wrote:
.Net 2003 V- 7.1.3088
Framework 1.1 V- 1.1.4322 SP1
WinXp SP2

I'm building a WinForms project and I have 3 levels of
forms( the MDI Form, a MDI child form, and a modal form
called from the MDI child form ). I have a member
declared in the MDI Form that I need to be able to
manipulate from within the other two forms and I'm not
sure of the best way to go about this ( I'm used to
ASP.net, where I would simply put this in the Session
object and call it from each page ). Can anyone point me
in the right direction here? Thanks!!!

Tom S.

Nov 21 '05 #2
That works perfectly, Thanks!!!!!

-----Original Message-----
Tom,

Create a new property for your MDI form that exposes the object you require.
Then, from the child form:

----
Me.MdiParent.YourProperty.SomeMethod()
----

For the modal form to access the property you need to pass a referenceto the MDI parent somehow. I personally suggest passing the reference asan argument to the modal form's constructor.

Regards,
-Adam.

Tom S. wrote:
.Net 2003 V- 7.1.3088
Framework 1.1 V- 1.1.4322 SP1
WinXp SP2

I'm building a WinForms project and I have 3 levels of
forms( the MDI Form, a MDI child form, and a modal form
called from the MDI child form ). I have a member
declared in the MDI Form that I need to be able to
manipulate from within the other two forms and I'm not
sure of the best way to go about this ( I'm used to
ASP.net, where I would simply put this in the Session
object and call it from each page ). Can anyone point me in the right direction here? Thanks!!!

Tom S.

.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dennis Gavrilov | last post by:
Hi, All! I have two questions: strategic and technical. Technical one first: I need to share an array of objects (implemented as hashes, having references to other objects and hashes, sharing...
0
by: Jan Rank | last post by:
We have DB2 for VSE V7.3 and run 2 VSE guest sharing members. Does anyone know what we need to do to access our DB2 running on one VSE member in multiple user mode from the CICS partition of the...
5
by: Tom | last post by:
I have created a C# User Control which house my header information. I have another development group that would like to use this but they are VB developers. Is their a way to leverage my C#...
6
by: David Sobey | last post by:
i'm trying to access the values of a set of controls on one form from another form. how do i do this without breaking the .NET convention of not declaring visible instance fields? do i have to make...
5
by: geoffblanduk_nospam | last post by:
Is it valid to share namespaces across projects in C#? For example, I have a project that contains the code for a core assembly, this builds a DLL. I then have a second project in the same...
3
by: Robert W. | last post by:
I'm embarking on a project that will have both a desktop application and a Pocket PC application. It seems logical to have as much code as possible sitting in a shared project, which would be...
2
by: Brad | last post by:
I have one of those seemingly simple questions that evades/confuses me. I've created an assembly with bass classes (classes meant to be inherited in other assemblys). In a secondary assembly (my...
1
by: Kris | last post by:
I read a column on sharing types between web services at http://msdn.microsoft.com/library/en-us/dnservice/html/service07162002.asp Sharing types can be acheived, similar to what described here...
1
by: David Belohrad | last post by:
Dear All, could someone give a hint? I'd like to share the resources as follows: A shared class which works as counter of number of shared resources: class Shared { public: Q_PCBShared()...
3
by: =?Utf-8?B?am1obWFpbmU=?= | last post by:
When I put asp controls inside the LoginView it removes the codebehind references so that the page will not build. For example: <asp:LoginView ID="LoginView" runat="server" > <LoggedInTemplate>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.