how call subA in classA

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

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
 
* "Frank said:
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()
///
 
"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/
 
Thanks Sahil,
I thougth about that, but I wondered if there was a better way. So I guess
not.
Frank
 
Back
Top