日期:2014-05-18  浏览次数:20720 次

vs2008 中listview控件滚动显示的问题
C# code

 DateTime dt = System.DateTime.Now.ToLocalTime();
            string str = dt.ToString();
            ListViewItem li = new ListViewItem(str);

            listView1.Items.Add(li);


C# code

 // 
            // listView1
            // 
            this.listView1.GridLines = true;
            this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
            this.listView1.Location = new System.Drawing.Point(24, 95);
            this.listView1.Name = "listView1";
            this.listView1.Size = new System.Drawing.Size(234, 136);
            this.listView1.TabIndex = 2;
            this.listView1.UseCompatibleStateImageBehavior = false;
            this.listView1.View = System.Windows.Forms.View.Details;



我通过这样子向listview添加一行一行的数据,但是listview中一直什么都没,一行记录都不显示。请问怎么样才能让添加的信息在listview中显示啊。我记得2005中好像可以这么弄的


------解决方案--------------------
添加代码没错