473,386 Members | 1,647 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.

how call subA in classA

Hello, how do I do this:

classA
sub A
dim frmA as new frmA
frmA.showdialog
end sub A

sub B
some stuff
end sub B
end classA
==========
frmA
call sub B in classA
end frmA

Forget the syntax, I want to call sub B in classA where frmA was created.
How do I do that?
Thanx for your help.
Frank

Nov 20 '05 #1
3 1187
* "Frank" <fr***@frank.com> scripsit:
classA
sub A
dim frmA as new frmA
frmA.showdialog
end sub A

sub B
some stuff
end sub B
end classA
==========
frmA
call sub B in classA
end frmA

Forget the syntax, I want to call sub B in classA where frmA was created.
How do I do that?


\\\
Dim x As New ClassA()
x.B()
///

- or -

If 'B' is marked as 'Shared':

\\\
ClassA.B()
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
"I want to call sub B in classA where frmA was created" .. so you want to
class SubB in that very instance of classA that frmA was instantiated from.

Overload constructor in frmA, pass in type classA into it.
During instantiation of frmA, pass in "Me",
Save that instance of Me in frmA
call Me.SubB where you want to

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/

"Frank" <fr***@frank.com> wrote in message
news:cb**********@news5.tilbu1.nb.home.nl...
Hello, how do I do this:

classA
sub A
dim frmA as new frmA
frmA.showdialog
end sub A

sub B
some stuff
end sub B
end classA
==========
frmA
call sub B in classA
end frmA

Forget the syntax, I want to call sub B in classA where frmA was created.
How do I do that?
Thanx for your help.
Frank

Nov 20 '05 #3
Thanks Sahil,
I thougth about that, but I wondered if there was a better way. So I guess
not.
Frank

"Sahil Malik" <no****@ms.com> wrote in message
news:#i**************@TK2MSFTNGP09.phx.gbl...
"I want to call sub B in classA where frmA was created" .. so you want to
class SubB in that very instance of classA that frmA was instantiated from.
Overload constructor in frmA, pass in type classA into it.
During instantiation of frmA, pass in "Me",
Save that instance of Me in frmA
call Me.SubB where you want to

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/

"Frank" <fr***@frank.com> wrote in message
news:cb**********@news5.tilbu1.nb.home.nl...
Hello, how do I do this:

classA
sub A
dim frmA as new frmA
frmA.showdialog
end sub A

sub B
some stuff
end sub B
end classA
==========
frmA
call sub B in classA
end frmA

Forget the syntax, I want to call sub B in classA where frmA was created. How do I do that?
Thanx for your help.
Frank


Nov 20 '05 #4

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

Similar topics

2
by: Thomas | last post by:
Hello im using Visual Studio .net And have troubel with the following line ClassA::~ClassA() { cerr<<__PRETTY_FUNCTION__<<"\n"; \\this works with g++ } on compiling I get this back:
1
by: Peter King | last post by:
if you assign multiple classes in order to keep your classes generic e.g ..classA { position.absolute; left:5 top:5 height:200 width:800 } ..classB { background-color: red} ..classC {...
23
by: Fabian Müller | last post by:
Hi all, my question is as follows: If have a class X and a class Y derived from X. Constructor of X is X(param1, param2) . Constructor of Y is Y(param1, ..., param4) .
3
by: mandatory | last post by:
hi, i have two classes: class A { public: virtual Push (void *p); };
4
by: c | last post by:
Hello All, I am struggling with simple casting issue within c# and would really appreciate some insight into where I am going wrong. I have two classes, ClassA and ClassB. Each implements a...
2
by: PawelR | last post by:
Hello Group, In my application I have few class, and I want call function with "master class". This is as master form (startClass) and option window (ClassA). My question is how call function...
4
by: Tim Gallivan | last post by:
Hello group, I'm trying to develop a proof of concept webservice which asynchronously calls a function in a DLL. The function raises an event when it is finished, and works when used as part of...
4
by: hyd | last post by:
With C++/CLI - VS2005, is it possible to have static constructors that are automatically called when the owner assembly is loading ? Otherwise, how it is possible to call it without creating an...
16
by: edepperson | last post by:
I've been looking for an answer to this problem and have seen the same question posted on other forums... but still no answer. My background is Delphi2 - 7 and I used to do this all the time with...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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,...

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.