473,494 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calling a Subroutine from another Form

I need to call a subroutine in FormA from within FormB.
Let FormA be an MDIForm and let FormB be its MDIChild
form. So, the FormB.MDIParent property will return an
object refernce to the FormA instance. At this point I
should see the Public subroutine I defined in FormA from
within FormB. It does not show-up! Am I missing someting
here? Is there any gurus out there who can give me some
pointers as to how to deal with the situation?

Thank you very much in advance.

Dursun
Nov 20 '05 #1
4 1970
Dursun,

FormA.subroutine

HTH
Gary
Nov 20 '05 #2
I wish it was so easy. The intellisensor (?) does not
detact the subroutine. The code is as follows

From within FormB...
Me.MDIParent.-
Here ir should show the Subroutine via intellisense. It
does not! Am I really getting a reference to the instance
of the FormA y using Me.MDIParent?

THANK YOU

-----Original Message-----
Dursun,

FormA.subroutine

HTH
Gary
.

Nov 20 '05 #3
* "Dursun" <an*******@discussions.microsoft.com> scripsit:
I need to call a subroutine in FormA from within FormB.
Let FormA be an MDIForm and let FormB be its MDIChild
form. So, the FormB.MDIParent property will return an
object refernce to the FormA instance. At this point I
should see the Public subroutine I defined in FormA from
within FormB. It does not show-up! Am I missing someting
here? Is there any gurus out there who can give me some
pointers as to how to deal with the situation?


See my reply to the other instance of your post.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
On Fri, 2 Jan 2004 09:32:51 -0800, Dursun wrote:
I wish it was so easy. The intellisensor (?) does not
detact the subroutine. The code is as follows

From within FormB...
Me.MDIParent.-
Here ir should show the Subroutine via intellisense. It
does not! Am I really getting a reference to the instance
of the FormA y using Me.MDIParent?


That's because Me.MDIParent refers to an instance of a System.Windows.Form.
Not an instance of a FormA. In order to see the members of the FormA
class, you must cast the MDIParent to an instance of FormA:

CType(Me.MDIParent,FormA).subroutine

When you hit the dot (.) you should see all the members of the FormA class.

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #5

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

Similar topics

2
5141
by: Chris | last post by:
Hi, Is it possible to start a subroutine in for example (frmMainForm) from another form (frmSubForm)? I want to start a subroutine called cmdButton1_Click. I wrote (in frmSubForm): ...
4
4945
by: Michael Farber | last post by:
Not sure if this is the right group for this but anyways... I've got an ASP web application that uses a Visual Basic component to do some work. I instantiate the component in asp and then...
2
4028
by: Giulio Belrango | last post by:
Hi I need someones help I'm working in an IBM 390 batch environment. What I'm trying to do is to call from a non DB2 COBOL program a DB2 COBOL program that will access a table and perform an...
30
2238
by: Tim Marshall | last post by:
Here's the scenario, A2003, Jet back end, illustrated with some cut down code at the end of the post: A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens it. There are several...
12
2874
by: Bigdakine | last post by:
I don't know if this is the right forum for this, and if not please suggest one which fits. I have to call a fortran sub routine from a C main program. The fortran subroutine statement is ...
5
4327
by: Amit | last post by:
I tried calling a subroutine in a fortran module from C ,but couldn't.I always get the error: undefined reference in the main.o file (main is in C calling the subroutine). for calling the...
2
1434
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
4
2579
by: otterbyte | last post by:
Hi, I have a bit of code which is confusing me to no end. Here are the basics: 1) The class module is being used in the module of a form. 2) There is an instance of the object declared at the...
7
5505
by: mirandacascade | last post by:
Note: I'm not sure if the subject line of this post uses the correct terminology, so apologies if the subject line turns out to be misleading. I think it's probably easier to provide a trivial...
0
7119
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
6989
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
7157
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,...
1
6873
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
5453
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,...
1
4889
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...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.