Main application object in vb.net

B

Byron Hopp

Is there a way to get a reference to the main application window object in
vb.net? Like an MDI app, I would like to get to the MDI Shell window.

Thanks,

Byron...
 
J

Jerry H.

if by Shell window, you mean the main form that is a Parent to all the
other child forms, you can do the following

'declare a local variable as your MDI parent form's class
Dim frmMainLcl As frmMain
'set the local variable to reference the child form's parent form
frmMainLcl = Me.MdiParent
'this line calls a Public sub routine in the MDI parent form from the
child form
frmMainLcl.updatestatusbar
 
B

Byron Hopp

Is there a way to do this via the Framework, I am attempting to create some
generic functions usable by other applications.

Thanks,


Byron...
 
C

Chris Dunaway

What do you mean when you say "via the framework"? The methods posted
are done using the framework. What are you trying to accomplish?
Perhaps there is another method which will work.
 
H

Herfried K. Wagner [MVP]

Byron,

Byron Hopp said:
Is there a way to do this via the Framework, I am attempting to create
some generic functions usable by other applications.

What's not generic enough with using 'Me.MdiParent'? How would you expect
the solution to look like?
 
B

Byron Hopp

Chris,

Im am trying to get this window without any knowledge of the existing
application, I don't want to have to write a special function in the app, or
have any knowledge of any child windows. Is there a function which will
return the main form without any parameters, or existing knowledge of the
running app?

Thanks,

Byron...
 
H

Herfried K. Wagner [MVP]

Byron,

Byron Hopp said:
Im am trying to get this window without any knowledge of the existing
application, I don't want to have to write a special function in the app,
or have any knowledge of any child windows. Is there a function which
will return the main form without any parameters, or existing knowledge of
the running app?

No. There is no general definition for "application's main form".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top