Note that there are some explanatory texts on larger screens.

plurals
  1. POProductName hides System.Windows.Forms.Control.ProductName
    primarykey
    data
    text
    <p>I have a property ProductName in my Form. I am getting warning while compiling the code.</p> <p><code>FormInventory.ProductName</code> hides inherited member '<code>System.Windows.Forms.Control.ProductName'</code>. Use the new keyword if hiding was intended.</p> <p>below is my code</p> <pre><code>public partial class FormInventory : Form, IInventoryView { public FormInventory() { } public string ProductName { get { return this.textProductName.text; } set { this.textProductName.text = value; } } } </code></pre> <p><code>textProductName</code> is a textbox. </p> <p>I know that <code>ProductName</code> hides the base class's property <code>Forms.Control.ProductName</code>. My question is</p> <ol> <li><p>Is it possible to suppress the warning without Renaming my <code>FormInventory.ProductName</code> property</p></li> <li><p>I am currently in the beginning of the development, if i hide this property with the <code>new</code> modifier will there be any problem at the time of releasing the product, because base property <code>Forms.Control.ProductName</code> returns the product name of the assembly containing the control. Where as my <code>FormInventory.ProductName</code> returns a user entered value.</p></li> <li><p>Where will we be using this <code>Forms.Control.ProductName</code>, because i have never used it before.</p></li> </ol> <p>I have searched and found Similar questions </p> <ul> <li><a href="https://stackoverflow.com/questions/7973478/entity-framework-hides-inherited-member-warning">Entity Framework hides inherited member Warning</a></li> <li><a href="https://stackoverflow.com/questions/451035/use-new-keyword-if-hiding-was-intended">Use new keyword if hiding was intended</a></li> </ul> <p>these questions doesn't solve my problem but helped me in understanding the cause for the warning.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload