473,405 Members | 2,272 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,405 software developers and data experts.

How to return a value from one form to another

JnrJnr
88
How do I return (or pass) a simple value of a variable from one windows form to another?

thanks!
Jul 24 '10 #1
2 1884
suppose that u have two forms Form1 and Form2.......
and two variables 'a' and 'b' where 'a' belongs to Form1 and 'b' belongs to Form2... now if you want to pass value of 'a' to 'b' ........

1) write a constructor in Form2 like

public Form2(int value)
{
b = value;
}

2) Now instansiate the Form2 in Form1 by passing the value of "a" to the constructor like

Form2 f2 = new Form2(a); //in Form1

now you will have the value of 'a' as 'b' in Form2
Jul 24 '10 #2
JnrJnr
88
@maddyromeo
Thank you maddyromeo!
Jul 26 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: dsimonneau | last post by:
Hello all, I would like to call a JSP from a Javascript and get a result on my javascript To call the JSP I'm doing like that : <SCRIPT LANGUAGE="Javascript1.1"> function test() {
8
by: Ravindranath Gummadidala | last post by:
Hi All: I am trying to understand the C function call mechanism. Please bear with me as I state what I know: "every invocation of a function causes a frame for that function to be pushed on...
3
by: JoeD | last post by:
I am creating a popup window based on a value that is sent to me. Another program is calling the popup windows. Basically by calling the popup program: C:\screenpop UUI: XXXXXXXX My question...
5
by: Dmitriy Lapshin [C# / .NET MVP] | last post by:
Hi all, I think the VB .NET compiler should at least issue a warning when a function does not return value. C# and C++ compilers treat this situation as an error and I believe this is the right...
8
by: bdobby | last post by:
Hi. I am relatively new to js, but I did think I was starting to get the hang of it. Then this happened... I have a form with an onsubmit event handler: <form id="uploadForm" method="post"...
4
by: Cylix | last post by:
I have a SP, which will exec other SP depend on the input. the "other SP" need to return a integer back. How to do this? Thanks for give me a hand.
1
by: mailpitches | last post by:
X-No-Archive: yes a function, the return value of the function is a boolean. What does this boolean value mean? Example: <body onload="document.getElementById('field').onkeydown=function(x) {...
1
by: ykhamitkar | last post by:
Hi there, How can i return value form a form. What I want to do is If I click on a button a new form opens up which has a calendar control. I select a date and click on close. and the date...
7
by: Terry Olsen | last post by:
How do I get this to work? It always returns False, even though I can see "This is True!" in the debug window. Do I have to invoke functions differently than subs? Private Delegate Function...
2
by: stephen | last post by:
Hi, I have a button on a webpage. Clicked event of this button opens another page for search and populates a datagrid or whatever and then I want to return value from this second page on to the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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.