在書面方式將此代碼到我的項目我得到的錯誤如何解決錯誤:不一致的可訪問性:泛型C#接口的參數類型?
Error 1 Inconsistent accessibility: field type
'System.Collections.Generic.List<Jain_milan.Childrendata>'
is less accessible than field'Jain_milan.addchild.m_children'
Error 2 Inconsistent accessibility: parameter type'System.Collections.Generic.List<Jain_milan.Childrendata>'
is less accessible than method'Jain_milan.addchild.addchild(System.Collections.Generic.List<Jain_milan.Childrendata>)'
namespace Jain_milan
{
public partial class addchild : Form
{
List<Label> label = new List<Label>();
List<TextBox> textbox = new List<TextBox>();
List<ComboBox> combobox = new List<ComboBox>();
List<DateTimePicker> datetimepicker = new List<DateTimePicker>();
public List<Childrendata> m_children = new List<Childrendata>();
public addchild(List<Childrendata> children)
{
InitializeComponent();
this.m_children = children; //Initialize the same List as sent by Mainform
}
難道你不明白什麼部分消息的? – SLaks 2013-05-07 13:46:13
仔細檢查您正在使用的類上的訪問修飾符。 – 2013-05-07 13:46:46
這就是說公共物品正在使用私人類型。確保訪問修飾符一致 – devshorts 2013-05-07 13:48:19