C# ListView 标题不显示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1936798/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ListView Headers Don't Show Up
提问by chobo2
I am doing a windows mobile application 6.1.
我正在做一个 Windows 移动应用程序 6.1。
I dragged in a listview and went to columns and added columns to my list view. When I run the listview they do not show up.
我拖入一个列表视图并转到列并将列添加到我的列表视图中。当我运行列表视图时,它们不显示。
I then tried to add them through C# code on page load with the follow code.
然后我尝试使用以下代码在页面加载时通过 C# 代码添加它们。
ColumnHeader header = new ColumnHeader();
header.Text = "gkgag";
header.Width = 100;
header.TextAlign = HorizontalAlignment.Center;
listView1.Columns.Add(header);
this does not work either. Why don't they show up?
这也不起作用。他们为什么不出现?
采纳答案by Jens Granlund
You must use detailed view for column headers to be visible.
您必须使用详细视图才能看到列标题。
listView1.View = View.Details;
If that′s not the problem, column headers might be hidden behind windows systembar.
如果这不是问题,列标题可能隐藏在 Windows 系统栏后面。