473,486 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Link multiple window forms

Hi, I'm building an engineering calculator. The calculator receives input
parameters in main window form, and I would like the results to be presented
on another form (pop-up window form), however, I'm new to C# and I don't know
how to link the i/o data from one form to another. I would be appreciated if
anyone give me some idea on how to do so.

Regards,

Johnny
Nov 16 '05 #1
1 1625
Johnny,

The C# (OOP) way is to, on your results form, have private member variables
that will hold your data. You then expose these to the outside world via
properties that allow a parent object to set or get (or both) values on each
data member.

I imagine it would look something like this...
inputform.cs
------------

// Inside the event handler for the button the user clicks on to get a
result.
// Named "Calculate" or something like that

// code to retrieve all the user parameters goes here

// code to put results into local variables here

// Display results
ResultsForm results = new ResultsForm(); //creates the result form
results.Pressure = appliedPressure;
results.Movement = appliedMovement;
// other engineering type values to pass here
results.ShowDialog(); // display the form

ResultsForm.cs
----------------

// variable declarations here
string pressureApplied = "";
int movementExpected = -1;
// other engineering type variables declared here

// Properites declared here
string Pressure
{
// if the parent needs to set this value externally
set
{
pressureApplied = value;
}

// if the parent needs to get this value
{
return pressureApplied ;
}
}

int Movement
{
set
{
movementExpected = value;
}
}

// all your functions here can now access pressureApplied and
movementExpected.
// if you want to generate a report, this should be done from the
Load event handler,
// and not the constructor since at time of construction the values
haven't been passed
// through yet...

Hope that helps.

Thanks.

Daniel.
"Johnny" <Jo****@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
Hi, I'm building an engineering calculator. The calculator receives input
parameters in main window form, and I would like the results to be
presented
on another form (pop-up window form), however, I'm new to C# and I don't
know
how to link the i/o data from one form to another. I would be appreciated
if
anyone give me some idea on how to do so.

Regards,

Johnny

Nov 16 '05 #2

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

Similar topics

7
3167
by: Evan Kontos | last post by:
I am using the window.open function to open a small window and I am using GET to get values back from that window. I want to be able to open another from the second window but I get an error...
0
1931
by: jon | last post by:
Using Visual C++ and MFC, one could generate a very nice MMI using CFormView and the method detailed in the MSDN "vswap" example to allow multiple forms to be viewed ( switched to ) within a single...
5
673
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
6
7233
by: Adam Tilghman | last post by:
Hi all, I have found that IE doesn't seem to respect the <SELECT> "multiple" attribute when set using DOM methods, although the attribute/property seems to exist and is updated properly. Those...
4
2697
by: kschneider | last post by:
Assume there's a form with it's action attribute all set to post to a URL, but without a submit control. Form submission is done via a link and I want to prevent the classic "double submit"....
3
12527
by: imrantbd | last post by:
This is my first problem.Please help me. I have the following code: <head> <script language="JavaScript"> function addSrcToDestList() { destList1 = window.document.forms.destList; srcList...
3
8699
by: imrantbd | last post by:
I need array type name like "destList" must use for my destlist select box,not a single name.Or need a solution to capture multiple value of "destList" select box and send all selected value in php...
1
19306
by: ykong1214 | last post by:
In my project, there is a single select tag, <html:select property="userName" size="7"> <html:options collection="UserList" property="value" labelProperty="label" /> </html:select> ...
1
3542
by: Mohit | last post by:
Hi all, I am working on a windows based client server application with multiple forms. All forms are having custom title bars with no default bars. There is one main form. Some forms are opened up...
0
7100
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
6964
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
7126
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,...
1
6842
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
5434
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
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
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
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
262
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.