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 / Design Time / July 2005

Tip: Looking for answers? Try searching our database.

IDesignerHost and the RootComponent

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Graham Allwood - 27 Jul 2005 10:57 GMT
Hi,

in the DesignHost why should the RootComponent be a Form even when the class
you may be designing is derived from a form?

Take for example a simple object graph of: (A form with 2 buttons and a user
control):

<MyForm>
   <button>
   <textbox>
   <MyUserControl>

When loading this graph in to the designer I alway have to create the
RootComponent as a Form rather than a MyForm, otherwise I find all the
controls on the design surface are readonly / locked. This doesn't follow
the same pattern for the rest of the object graph. For example when I come
to add the MyUserControl to the host I can created an instance of
MyUserControl, not one of its base class.

Hope I'm making sense here!!

Regards

Graham
Robert Conde - 28 Jul 2005 20:03 GMT
It's not that it has to be a form...rather it has to be the base class. So
if you had class MyMyForm : MyForm then you could create a MyForm as the
root component. Why? Well think about it...if it were showing the form
you're working on then it would have to compile first...so if you had
anything in your class that didn't compile you could show the form. Though I
can't put my finger on it I'd think there'd also be an infinite recursion
problem. Anyhow...some things to think about.

Robert Conde

> Hi,
>
[quoted text clipped - 21 lines]
>
> Graham

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.