1

Error 1 'System.Windows.Forms.TabPage' does not contain a definition for 'Items' and no extension method 'Items' accepting a first argument of type 'System.Windows.Forms.TabPage' could be found (are you missing a using directive or an assembly reference?)

private void btnReadandPrint_Click(object sender, EventArgs e)
    {
        reader = new StreamReader(openFileDialog1.FileName);

        ResetFile();

        do
        {
            s += reader.ReadLine() + "";
            counter++;

            if (counter % 5 == 0)
            {
                tabPage1.Items.Add("Line" + counter + ":" + s);
                s = "";
            }
        } while (!reader.EndOfStream);
    }
4

1 回答 1

3

TabPage 不是列表框。向页面添加一个列表框并向其中添加项目。

于 2012-12-04T01:35:36.853 回答