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 2008

Tip: Looking for answers? Try searching our database.

Using classes not derived from control at design time?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Toma Catalin - 17 Jul 2008 10:12 GMT
Hy there, I am working on a project and I want to add design time support. My
problem is that I don't want to create controls. For example,some times I
just need a class tat has a location,size and an Image propoerty, and I want
to set this properties at design time. I don't need to derive from Control.
Is there any way I can create a lightweight control+designer? A control has
hundreds of properties..they slow down my application. I just want to drag a
class on the form and to see serialized code for 3 properties.
Thanks in advance.
Signature

Toma Catalin, Microsoft Student Partner

eschneider - 21 Jul 2008 20:54 GMT
Try making a simple control with you three properties and mark all unneeded
properties with:

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

You can also use properties ShouldSerialize[Property Name] to dynamically
determine serialization.

You may need to shadow existing properties to hide them.

Schneider

> Hy there, I am working on a project and I want to add design time support.
> My
[quoted text clipped - 9 lines]
> class on the form and to see serialized code for 3 properties.
> Thanks in advance.
Toma Catalin - 22 Jul 2008 11:14 GMT
My problem is the hierarchy behind the Control. Plus, it has a HWND, so it's
like I am creating a form without a border. For most of my needs,I don't need
messages to be passed to my visual classes. I know I can hide all code
serialization, bot it's still a Control that is derived and implements a lot
of classes and interfaces, wich I don't need.

I started deriving my classes from Component, but I still can't write a
designer that will show my Component at design time on the visual surface...
Signature

Toma Catalin, Microsoft Student Partner

> Try making a simple control with you three properties and mark all unneeded
> properties with:
[quoted text clipped - 21 lines]
> > class on the form and to see serialized code for 3 properties.
> > Thanks in advance.
eschneider - 23 Jul 2008 21:33 GMT
All controls are forms underneath, there is no way around it.

Maybe you want to create your own design surface (like a custom drawn design
surface), otherwise I think what I suggested it the best approach.

Schneider

> My problem is the hierarchy behind the Control. Plus, it has a HWND, so
> it's
[quoted text clipped - 38 lines]
>> > class on the form and to see serialized code for 3 properties.
>> > Thanks in advance.

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.