Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2004

Tip: Looking for answers? Try searching our database.

Forms in Class Libaries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wayne - 30 Jun 2004 14:35 GMT
I have a class lib, that creates and shows a form. When the main app is
minimized the form from the class lib isn't. Also when pressing Alt+Tab the
class lib form shows in the window selection.

How do I make it minimize when the application is minimized and not show in
the alt+tab window?

Thanks
Wayne
Stoitcho Goutsev \(100\) [C# MVP] - 30 Jun 2004 15:52 GMT
Hi Wayne,

First set the lib form ShowInTaskbar property to false.
Second befre showng the lib form set its Owner (not Parent) property to
reference the application main form

Signature

HTH
Stoitcho Goutsev (100) [C# MVP]

> I have a class lib, that creates and shows a form. When the main app is
> minimized the form from the class lib isn't. Also when pressing Alt+Tab the
[quoted text clipped - 5 lines]
> Thanks
> Wayne
Wayne - 30 Jun 2004 16:12 GMT
Ok, how do I do this?

Guess what I need to know is from the Form in the class lib, how do I get
the applications main form? Not sure if this matters, but the class libs are
dynamiclly loaded at run time. They are not referanced in the main
application. These are for my in the works plugin system.

Thanks
Wayne

> Hi Wayne,
>
[quoted text clipped - 13 lines]
> > Thanks
> > Wayne
AlexS - 30 Jun 2004 16:26 GMT
Hi, Wayne

How class libs are loaded if they are not referenced?

When you create classes from class libs, you can pass parent form reference,
for example in constructor parameters. Or through any interface methods you
defined - if any.

HTH
Alex

> Ok, how do I do this?
>
[quoted text clipped - 23 lines]
> > > Thanks
> > > Wayne
Wayne - 30 Jun 2004 18:14 GMT
Basiclly I look for files in the source dir with a given ext. I then use
Assembly.LoadFrom(fileName) to load the assembly. From there I ittirate
through all the types contained in the assembly looking for types that
inherit from my base class. When Found I create an instance of the type and
add a menu item for that type, setting the on click of the menu to a method
of the new instance. When the user clicks the menu item it does what ever
was in the assembly to be done.

Currently there is no way in my set up to pass the main form, The app I have
has already been deployed and not sure how difficult it will be for me to
have to change the class interface that is being used with in the app.

Hope the above makes sense.
Thanks
Wayne

> Hi, Wayne
>
[quoted text clipped - 38 lines]
> > > > Thanks
> > > > Wayne
Stoitcho Goutsev \(100\) [C# MVP] - 30 Jun 2004 16:35 GMT
Wayne,

Frankly I don't know haw to get the main form. Normaly the main form has to
do this, I believe. Anyways try to use Process.MainWindowHandle and then
Control.FormHandle or Control.FromChildHandle. However I don't know how it
works in the cases where the process host more than one AppDomains or the
process has more than one top level windows. What internaly this property
does is to enumerate all top level windnows and returns the first one which
is created by a thread in the process.

Signature

Stoitcho Goutsev (100) [C# MVP]

> Ok, how do I do this?
>
[quoted text clipped - 23 lines]
> > > Thanks
> > > Wayne

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.