473,386 Members | 1,712 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,386 software developers and data experts.

Accessing Forms

If I have a parent form (form1) and 2 child forms (Form2 and Form3).
How can I excecute a function that located on Form3 from Form2 ?

I'm using this commands to load the child forms: (VB.NET 2003)
Private WithEvents frm2 as Form = New Form2
Private WithEvents frm3 as Form = New Form3

frm2.MdiParent = Me
frm2.Show
frm3.MdiParent = Me
frm3.Show

Nov 21 '05 #1
8 931
"Alex Levi" <Al******@discussions.microsoft.com> schrieb:
If I have a parent form (form1) and 2 child forms (Form2 and Form3).
How can I excecute a function that located on Form3 from Form2 ?

I'm using this commands to load the child forms: (VB.NET 2003)
Private WithEvents frm2 as Form = New Form2


'...As New Form2'.

Calling a function:

\\\
frm2.Foo()
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #2
I still can't access this function because frm2 and frm3 located and declared
in Form1 and and I'm tring to call a function that located on Form3 from
Form2.
This form don't use inheretince.
"Herfried K. Wagner [MVP]" wrote:
"Alex Levi" <Al******@discussions.microsoft.com> schrieb:
If I have a parent form (form1) and 2 child forms (Form2 and Form3).
How can I excecute a function that located on Form3 from Form2 ?

I'm using this commands to load the child forms: (VB.NET 2003)
Private WithEvents frm2 as Form = New Form2


'...As New Form2'.

Calling a function:

\\\
frm2.Foo()
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #3
Alex,

I have made yesterday a sample and sand it to this newsgroup.

http://groups.google.com/groups?selm...TNGP10.phx.gbl

I hope that it helps?

Cor
Nov 21 '05 #4
thanks, but I managed to load the childs forms, and the question is if I have
a function in the Form2 (in another file):
Public aaa(byVal bbb as string)
{
///
\\\
}

how can I call to this function from Form3 (also that located in another
file).
The problem is that all of this forms are different classes and I can't make
a direct access from one class to another.

"Cor Ligthert" wrote:
Alex,

I have made yesterday a sample and sand it to this newsgroup.

http://groups.google.com/groups?selm...TNGP10.phx.gbl

I hope that it helps?

Cor

Nov 21 '05 #5
Alex,

Did you try the sample, because in my opinion is the answer on your last
question in it. It is not a sample how to open a form, it is a sample how to
use the forms from other forms.

In a MDI situation.

I hope this helps?

Cor
Nov 21 '05 #6
On Tue, 19 Oct 2004 14:35:05 -0700, Alex Levi wrote:
I still can't access this function because frm2 and frm3 located and declared
in Form1 and and I'm tring to call a function that located on Form3 from
Form2.
This form don't use inheretince.


In order for frm2 to access a function in frm3, it must have a reference to
frm3. You must pass a reference to frm3 into frm2 and then frm2 could
access the methods of frm3.

Perhaps a better way would be to take the function out of frm3 and put it
in a public module so that it could be accessed by all forms.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
Nov 21 '05 #7
The problem with the module is that I can put the function in it for all
forms, but I need a function that changes data on the form. I can call this
funciton from form3 and it will change the data in form3, but I can't call
this function from form2 so it will change the data on form3.

"Chris Dunaway" <"dunawayc[[at]_lunchmeat" wrote:
On Tue, 19 Oct 2004 14:35:05 -0700, Alex Levi wrote:
I still can't access this function because frm2 and frm3 located and declared
in Form1 and and I'm tring to call a function that located on Form3 from
Form2.
This form don't use inheretince.


In order for frm2 to access a function in frm3, it must have a reference to
frm3. You must pass a reference to frm3 into frm2 and then frm2 could
access the methods of frm3.

Perhaps a better way would be to take the function out of frm3 and put it
in a public module so that it could be accessed by all forms.

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.

Nov 21 '05 #8
I was maneged to call some default function from form3, for example: forms
text, enable, visible, exc'...

But how can I load a function that is not a default and it's not listed in
the methods list.

The parameter 'frm' can access some of the default function and my function
is not listed in the method list although it's declared as public.
The question is how can I access the function 'public sub aaa()' that
located on Form2 from Form3 ?
Nov 21 '05 #9

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

Similar topics

5
by: Craig Anderson | last post by:
Can anyone tell me the best way to access a hidden object in a form? I could use a hard-coded index to the elements of the form, but it's too easy to add something before the hidden object and mess...
5
by: Rune Runnestø | last post by:
How do I focus the cursor in the input field 'numberField' when accessing this jsp-file (or html-file) ? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>...
6
by: Chris Styles | last post by:
Dear All, I've been using some code to verify form data quite happily, but i've recently changed the way my form is structured, and I can't get it to work now. Originally : The form is...
6
by: Jeff | last post by:
Has anyone had any luck accessing an Oracle database from a web service? I have a C# DLL with various code to query an Oracle database. If I call the methods in this DLL from a Windows Forms...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
0
by: aakash | last post by:
Hello Guys I am upsizing ms access project to give it a ms sql connectivity I am having problem in accessing form control values in ms sql function CREATE FUNCTION "ReportList DateRange"() ...
3
by: judy.j.miller | last post by:
Does anyone know why i can't access a form element value using dot notation in firefox, when i'm in a function. Works ok in the body. I'm trying to do this: var FarTemp = faren.temp.value; I...
4
by: nottarealaddress | last post by:
I'm trying to get my feet wet in VB2005 (our new standard at work after officially stopping new development in VB6 about a month ago). I'm working with a simple sql 2005 table of 50 entries, one...
0
by: Roger Stoller | last post by:
Hello. I have developed a COM object using ATL. It seems to work fine when accessing it from VB.NET most of the time. However, I want to use a delegate in VB to asynchronously run a method in...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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:
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
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
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...

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.