项目有错误,但我尝试声明并使用它仍然有错误

时间:2016-09-23 01:07:37

标签: c#

请帮助我。我无法弄清楚为什么是错误...

private void Form1_Load(object sender, EventArgs e)
{
    int i = 0;
    string[] dirs = Directory.GetDirectories(@"C:\Users\Desktop\Food");
    foreach (string dir in dirs)
    {
        flowLayoutPanel1.Items.Add(dir, i);
        i++;
        if (i == imageList1.Images.Count - 1)
            i = 0;
    }
}
  

错误1'System.Windows.Forms.FlowLayoutPanel'不包含'Items'的定义,也没有扩展方法'Items'接受类型'System.Windows.Forms.FlowLayoutPanel'的第一个参数'(是你错过了使用指令或程序集引用?)

0 个答案:

没有答案
相关问题