獲取以下錯誤。我試圖在點擊第一個表單上的按鈕後跳轉到新表單。我需要傳遞一個類對象的列表。不一致的可訪問性:參數類型不易訪問
錯誤1可訪問性不一致:參數類型 'System.Collections.Generic.List' 比方法更少可訪問 'Preferred_Customer.AddCustomer.AddCustomer(System.Collections.Generic.List)' C:\用戶\羅恩\文件\視覺 工作室2013 \項目\優選的客戶\優選 客戶\ AddCustomer.cs 18 16優惠顧客
這裏是代碼創建的形式;
private void addCustomerButton_Click(object sender, EventArgs e)
{
AddCustomer myAddCustomer = new AddCustomer(preferredCustomerList);
myAddCustomer.ShowDialog();
}
這是來自AddCustomer的代碼;
namespace Preferred_Customer
{
public partial class AddCustomer : Form
{
private List<PreferredCustomer> addCustomerList;
public AddCustomer(List<PreferredCustomer> inPreferredCustomerList)
{
InitializeComponent();
addCustomerList = inPreferredCustomerList;
}
有人能說出我錯過了什麼嗎?
「PrefferedCustomer」類定義在哪裏?如果它不公開,那就需要。 –
PreferredCustomer類是否爲私人類? – rjdevereux