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 / May 2006

Tip: Looking for answers? Try searching our database.

Need CodeDomSerializer?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vrml97@gmail.com - 28 Apr 2006 02:59 GMT
Hi ,
       I  have a user control using custom class  as property,

Custom Class,
    public class myMarginBound : System.Drawing.Printing.Margins
    {
        public myMarginBound()
        {

        }
    }

User control,
    public class UserControl1 : System.Windows.Forms.UserControl
    {
                     ....................

        public myMarginBound MBound

        {
            set
            {

            }
            get
            {
                return new myMarginBound ();
            }
        }
                     }

Windows App,

              Designer generate
                      this.userControl11.MBound =
((WindowsControlLibrary1.myMarginBound)(new
System.Drawing.Printing.Margins(100, 100, 100, 100)));

It throw  invalidCastException at runtime,

Is it neccecery to write a custom CodeDomSerializer to generate
something like
this.userControl11.MBound = new myMarginBound()
?

Ben
Mark Olbert - 02 May 2006 02:57 GMT
Have you tried creating a TypeConverter for the class, and returning an InstanceDescriptor?

- Mark
Kongchau - 03 May 2006 14:00 GMT
Hi Mark,

      It works, thanks a lot.

Ben

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.