Groups | Blog | Home
all groups > vb.net upgrade > july 2003 >

vb.net upgrade : Calling functions embedded in ActiveMDIChild form


John Lee
7/3/2003 11:31:51 AM
Does anybody know how to call the function embedded in the ActiveMDIChild
form?

Dim variable1 as integer
variable1 = 1450
Me.ActiveMDIChild.function1(variable1)

raises error.

Any help would be appreciated.

Thank you.

John Lee
7/3/2003 1:41:59 PM
Hi. Thank you for your suggestion.

One thing I do not know for sure what to do is what to put in place of "type
of MDI"

For example, when I put in
DirectCast(Me.ActiveMDIChild, Form).function1(variable1)

It says that function1 is not a member of Sysm.Windows.Forms.Form.
The same thing with CType for any controls.

Any idea?

Thanks.

John Lee


[quoted text, click to view]

John Lee
7/3/2003 1:51:18 PM
Hi. Thank you for your suggestion.

One thing I do not know for sure what to do is what to put in place of "type
of MDI"

For example, when I put in
DirectCast(Me.ActiveMDIChild, Form).function1(variable1)

It says that function1 is not a member of Sysm.Windows.Forms.Form.
If I put in the class name of the MDIChild form it works, but then it
defeats the purpose of utilizing ActiveMDIChild.

The same thing with CType for any controls.

Any idea?

Thanks.

John Lee


[quoted text, click to view]

John Lee
7/3/2003 1:55:31 PM
When I do that, yes, it works.
But my predecessor who programmed this used the same function name in
different MDI child forms to do a slightly different task. So, what I need
is some way of utilizing the function1 for whichever ActiveMDIChild, not a
specific MDIChild form. That is why I can't specify the name of that.

Any more suggestions?

I really appreciate your help.


[quoted text, click to view]

Herfried K. Wagner
7/3/2003 6:47:57 PM
Hello,

"John Lee" <tonydemello@hotmail.com> schrieb:
[quoted text, click to view]

Untested:

\\\
DirectCast(Me.ActiveMdiChild, <type of mdi child>).Function1( _
variable1 _
)
///

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet

Herfried K. Wagner
7/3/2003 8:27:56 PM
Hello,

"John Lee" <tonydemello@hotmail.com> schrieb:
[quoted text, click to view]

The value of the child form's "(Name)" property (the class name).

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet

Herfried K. Wagner
7/3/2003 8:48:09 PM
Hello,

"John Lee" <tonydemello@hotmail.com> schrieb:
[quoted text, click to view]

Do all child forms contain a textbox called TextBox1? Do all of them
inherit from a base child form which defines the textbox?

Regards,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet

AddThis Social Bookmark Button