我的屏幕底部有一个警告:
Warning 1 'WindowsFormsApplication2.EventControlDataSet.Events' hides inherited member 'System.ComponentModel.MarshalByValueComponent.Events'. Use the new keyword if hiding was intended. C:\Users\myComputer\Desktop\Event Control\WindowsFormsApplication2\EventControlDataSet.Designer.cs 112 32 eventControl
如果我双击它,它会出现:
public EventsDataTable Events {
get {
return this.tableEvents;
}
谁能告诉我如何摆脱它?
最佳答案
你的类有一个基类,这个基类还有一个名为 Events 的属性(不是虚拟的或抽象的),它被你的类覆盖了。如果您打算覆盖它,请在 public 修饰符之后放置“new”关键字。例如
public new EventsDataTable Events
{
..
}
如果您不想覆盖它,请将您的属性名称更改为其他名称。
关于c# - "Use the new keyword if hiding was intended"警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19193821/