PC Review


Reply
Thread Tools Rate Thread

Accessing Forms

 
 
=?Utf-8?B?QWxleCBMZXZp?=
Guest
Posts: n/a
 
      19th Oct 2004
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

 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      19th Oct 2004
"Alex Levi" <(E-Mail Removed)> 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/>
 
Reply With Quote
 
=?Utf-8?B?QWxleCBMZXZp?=
Guest
Posts: n/a
 
      19th Oct 2004
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" <(E-Mail Removed)> 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/>
>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      20th Oct 2004
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


 
Reply With Quote
 
=?Utf-8?B?QWxleCBMZXZp?=
Guest
Posts: n/a
 
      20th Oct 2004
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
>
>
>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      20th Oct 2004
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


 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      20th Oct 2004
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.
 
Reply With Quote
 
=?Utf-8?B?QWxleCBMZXZp?=
Guest
Posts: n/a
 
      22nd Oct 2004
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.
>

 
Reply With Quote
 
=?Utf-8?B?QWxleCBMZXZp?=
Guest
Posts: n/a
 
      22nd Oct 2004
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 ?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing the forms in personal forms TJAC Microsoft Outlook Form Programming 0 26th Feb 2010 07:25 PM
Accessing sub forms Adam.Tyson@charteris.com Microsoft Access 2 25th Oct 2007 12:55 PM
Accessing forms from different project Dimsion Microsoft Dot NET Framework Forms 2 15th Feb 2007 06:58 AM
Accessing a Forms Properties =?Utf-8?B?Q2hhcGxhaW4gRG91Zw==?= Microsoft Excel Programming 3 20th Apr 2006 04:06 PM
Accessing forms properties peterDavey Microsoft Access Form Coding 5 12th Aug 2005 12:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 PM.