Eliminate control property

Posted on 2006-06-01
Last Modified: 2010-04-23
I have created an extended version of DataGridView and now I want to set some of the inherited control's properties to fixed values and remove them from the properties editor. How?
Question by:tmostad
    LVL 96

    Accepted Solution

    1) Override any overridable properties, shadow all others (if possible)

    2) Add the <System.ComponentModel.Browsable(False)> attribute to the property.

    LVL 1

    Author Comment

    OK, good but how do I shadow a property that also happens to be a compiler keyword, specifically ReadOnly in this case. I want my grid to always be read only so I will shadow that property but obviously the compiler is complaining about my choice of property name.
    LVL 1

    Author Comment

    Oh yeah I should also add that the ReadOnly property for DataGridView is not overridable so I can't do that either.
    LVL 96

    Expert Comment

    by:Bob Learned
    You can use any keyword as variables, if you surround the name with brackets.

    Public Property [ReadOnly] As Boolean
      End Get
      End Set
    End Property


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now