4 Replies - 746 Views - Last Post: 08 November 2008 - 12:35 AM Rate Topic: -----

#1 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 40
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Removing Properties

Posted 07 November 2008 - 05:49 PM

I am working on creating Custom Controls. I am adding my own Properties to the Control. I can't figure out how to remove some of the Default Properties, like: ForeColor, BackColor, Dock. I have tried searching Google, but have had no luck. I know how to override Properties such as ForeColor, BackColor, and Dock, but I just want to get rid of them.
Is This A Good Question/Topic? 0
  • +

Replies To: Removing Properties

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Removing Properties

Posted 07 November 2008 - 06:42 PM

Check out the following link about midway down the page. You will see an example of how to do it.

http://www.devnewsgr.../topic4152.aspx
Was This Post Helpful? 1
  • +
  • -

#3 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 40
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Re: Removing Properties

Posted 07 November 2008 - 10:46 PM

Thanks
Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Removing Properties

Posted 08 November 2008 - 12:24 AM

Using the Browsable property looks something like this

[Browsable(false)]
 public int MyIntProperty {
    get { return 0; }
    set { // Insert code here. }
 }



Setting it to false means that the developer cannot see nor access that property. This can be done with methodws as well. Hope that helps :)
Was This Post Helpful? 1
  • +
  • -

#5 gbertoli3  Icon User is offline

  • DIC at Heart + Code
  • member icon

Reputation: 40
  • View blog
  • Posts: 1,162
  • Joined: 23-June 08

Re: Removing Properties

Posted 08 November 2008 - 12:35 AM

OK Thanks, That is much easier to remember.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1