我的意图是简单地将英尺转换为米。您能否提供有用的建议来填充“米”列?编写以下代码以在 Visual Studio 2008 C++ 的列表视图中显示两列:
//Show details
listView1->View = View::Details;
//Allow the user to change text
listView1->LabelEdit = true;
listView1->GridLines = true;
//Add 2 columns and 2 rows
listView1->Columns->Insert(0,"Feet",150, HorizontalAlignment::Center);
listView1->Items->Insert(0, "50");
listView1->Items->Insert(1, "20");
listView1->Columns->Insert(1,"Meters", 150, HorizontalAlignment::Center);
listView1->Items->Insert(0, "15.24");
listView1->Items->Insert(1, "6.10");
listView1 中的错误输出是:
Feet Meters
15.24
6.10
50
20
listView1 中的输出应如下所示:
Feet Meters
50 15.24
20 6.10
我确信我错过了一些简单的东西。感谢您的任何帮助:)