Main application object in vb.net

  • Thread starter Thread starter Byron Hopp
  • Start date Start date
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...
 
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
 
Is there a way to do this via the Framework, I am attempting to create some
generic functions usable by other applications.

Thanks,


Byron...
 
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.
 
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?
 
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...
 
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".
 
Back
Top