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

problems between two forms

Hello.

I have two forms: Form1 and Form2

in Form1 i have a Subroutine like:

Sub test(Byval valin as String)
......
End Sub

in form1 i call the form2, then in form2 after some calculations, i want to
activate the form1 and send there a value to be calculate in sub Test.
how can i do this?

Thanks
Sep 20 '06 #1
4 1096
Create a property or field in the second class, which is of the type of the
first class. Assign that property when the first class launches an instance
of the second.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer

A watched clock never boils.

"vitorjol" <vi******@discussions.microsoft.comwrote in message
news:F5**********************************@microsof t.com...
Hello.

I have two forms: Form1 and Form2

in Form1 i have a Subroutine like:

Sub test(Byval valin as String)
.....
End Sub

in form1 i call the form2, then in form2 after some calculations, i want
to
activate the form1 and send there a value to be calculate in sub Test.
how can i do this?

Thanks

Sep 20 '06 #2

can u give me an example?

"Kevin Spencer" wrote:
Create a property or field in the second class, which is of the type of the
first class. Assign that property when the first class launches an instance
of the second.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer

A watched clock never boils.

"vitorjol" <vi******@discussions.microsoft.comwrote in message
news:F5**********************************@microsof t.com...
Hello.

I have two forms: Form1 and Form2

in Form1 i have a Subroutine like:

Sub test(Byval valin as String)
.....
End Sub

in form1 i call the form2, then in form2 after some calculations, i want
to
activate the form1 and send there a value to be calculate in sub Test.
how can i do this?

Thanks


Sep 20 '06 #3
Code in Form1 (Host Form)
*********************

private Form2 _Form2;

private void LaunchForm2()
{
_Form2 = new Form2();
//...
_Form2.Form1 = this;
}

Code in Form2
*********************
internal Form1 Form1;
--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer

A watched clock never boils.
"vitorjol" <vi******@discussions.microsoft.comwrote in message
news:3D**********************************@microsof t.com...
>
can u give me an example?

"Kevin Spencer" wrote:
>Create a property or field in the second class, which is of the type of
the
first class. Assign that property when the first class launches an
instance
of the second.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer

A watched clock never boils.

"vitorjol" <vi******@discussions.microsoft.comwrote in message
news:F5**********************************@microso ft.com...
Hello.

I have two forms: Form1 and Form2

in Form1 i have a Subroutine like:

Sub test(Byval valin as String)
.....
End Sub

in form1 i call the form2, then in form2 after some calculations, i
want
to
activate the form1 and send there a value to be calculate in sub Test.
how can i do this?

Thanks



Sep 20 '06 #4
Thanks. Can u give me the code in VB .Net ?

"Kevin Spencer" wrote:
Code in Form1 (Host Form)
*********************

private Form2 _Form2;

private void LaunchForm2()
{
_Form2 = new Form2();
//...
_Form2.Form1 = this;
}

Code in Form2
*********************
internal Form1 Form1;
--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer

A watched clock never boils.
"vitorjol" <vi******@discussions.microsoft.comwrote in message
news:3D**********************************@microsof t.com...

can u give me an example?

"Kevin Spencer" wrote:
Create a property or field in the second class, which is of the type of
the
first class. Assign that property when the first class launches an
instance
of the second.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer

A watched clock never boils.

"vitorjol" <vi******@discussions.microsoft.comwrote in message
news:F5**********************************@microsof t.com...
Hello.

I have two forms: Form1 and Form2

in Form1 i have a Subroutine like:

Sub test(Byval valin as String)
.....
End Sub

in form1 i call the form2, then in form2 after some calculations, i
want
to
activate the form1 and send there a value to be calculate in sub Test.
how can i do this?

Thanks


Sep 21 '06 #5

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

Similar topics

9
by: Eva | last post by:
Hi, I wanted to know how i can enter values into a specific column of a listview. I have tried the following code but this seems to enter all my values into the first column!!! Can anyone...
2
by: Tamlin | last post by:
Hi all, I'm getting a bug with the datagrid object. I've created one from scratch, bound it to a dataview with 2 int32 columns and formatted the output as currency. I've found that when you...
9
by: please-answer-here | last post by:
What is wrong with this code? when i place "return false" before the xfab assignment the form as intended doesn't submit. But when placed as here or in the last if/else construct the page gets...
0
by: JMCN | last post by:
i have been running into some ftp problems. when i run the ftp, the log indicates that it has been ftp'd. here is my ftp log: USER XX PASS XXX CONNECT XXX.dns.com CD $1$DKB101: GET...
6
by: Andy | last post by:
Hello, I am having many problems with setting up a parameter query that searches by the criteria entered or returns all records if nothing is entered. I have designed an unbound form with 3...
3
by: Bill C. | last post by:
Hello, I know this has been discussed a lot already because I've been searching around for information the last few weeks. I'm trying to implement a DataGridComboBoxColumn class. I've found...
3
by: Scott | last post by:
Hello, we are having problems displaying non-aspx files (images, style sheets) since we have upgraded to the 1.1 framework when using a cookieless session (sessionID in the url). Check out...
4
by: john | last post by:
I'm having some Interop problems. I really need someone's help on this, i'm running out of ideas. I have upgraded my Data access controls to the latest ver. Now then i have a form with these...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
2
by: Magnus Bergh | last post by:
I got a weird problem with designer. I have created a spearate assembly (DLL) containing my dataset classes and other classes which are shared bewteen the projects in the solution. When I try to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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,...

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.