I have a property ProductName in my Form. I am getting warning while compiling the code.
FormInventory.ProductName
hides inherited member 'System.Windows.Forms.Control.ProductName'
. Use the new keyword if hiding was intended.
below is my code
public partial class FormInventory : Form, IInventoryView
{
public FormInventory()
{
}
public string ProductName
{
get { return this.textProductName.text; }
set { this.textProductName.text = value; }
}
}
textProductName
is a textbox.
I know that ProductName
hides the base class's property Forms.Control.ProductName
. My question is
Is it possible to suppress the warning without Renaming my
FormInventory.ProductName
propertyI am currently in the beginning of the development, if i hide this property with the
new
modifier will there be any problem at the time of releasing the product, because base propertyForms.Control.ProductName
returns the product name of the assembly containing the control. Where as myFormInventory.ProductName
returns a user entered value.Where will we be using this
Forms.Control.ProductName
, because i have never used it before.
I have searched and found Similar questions
these questions doesn't solve my problem but helped me in understanding the cause for the warning.