Results 1 to 4 of 4

Thread: Custom Object Properties (C#)

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2012
    Location
    Sweden
    Posts
    44

    Custom Object Properties (C#)

    Hello all.

    I have created a custom control:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.ComponentModel;
    
    namespace NewApp
    {
        class Application : Panel
        {
            private bool isRunning = false;
    
            [Description("Is the application running?")]
            [Category("Super Stuff")]
            [DefaultValue(false)]
    
            public bool IsRunning
            {
                get { return isRunning; }
            }
    
        }
    }
    How can I set default values of this control, e.g width, height, backcolor, location?
    Since it's a panel, is there a way to add objects to the panel by default, e.g picturebox, textbox?

    Thanks!
    Last edited by ErikJohansson; Oct 18th, 2012 at 02:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width