我用多种形式搜索了这个问题,但找不到适用于我的答案..
我在Windows窗体应用程序中有一个列表视图框,我在运行时添加一些项目,如下所示的代码:
lvinfo.Items.Add("Script executed successfully in " + dbname + " database");我使用多次相同的代码来执行更新,当我将视图作为列表或其他内容时,这可以正常工作...
而且我也没有在我的代码中随时清除这些项目。当我用Google搜索时,我可以找到与清除项目相关的答案。
我的问题是当我将视图属性设置为详细信息时,列表视图框中的文本/内容不会显示..或者它被隐藏..
编辑:
我试过了
columnHeader1.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);任何回应都会非常感激..
I googled this question in many forms but couldn't find an answer applicable to me also..
I have a list view box in windows forms application and in that I add some items in runtime like the code I shown below:
lvinfo.Items.Add("Script executed successfully in " + dbname + " database");The same code I am using several times for updates of execution and this works fine when I give the view as list or something else...
And also I am not clearing these items at any point of time in my code..When I googled I could find the answers related to clearing items..
My problem is when I set view property as Details, the text/content in the list view box is not displayed..or it is hidden..
EDIT:
I tried
columnHeader1.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);Any response would be really appreciated..
最满意答案
我想这是因为你没有在列表视图中添加任何列。 在详细信息视图中,您应添加至少一列以显示您的项目。在添加项目之前尝试此操作:
listView1.Columns.Add("myColumnHeader");I guess it is because you haven't add any columns to your list view. In details view you should add at least one column to display your item.Try this before adding your items:
listView1.Columns.Add("myColumnHeader");更多推荐
发布评论