2
我正在写一个简单的任务列表应用程序作为Windows窗体和C#中的练习,这两者我都很新。我使用下面的代码来尝试在ListView中显示进程ID(我在Visual Studio中的设计视图中进行过),但是当我运行它时,项目不会显示。C#项目不会出现在ListView中
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var currentWindow = new taskMngrWndw();
Application.Run(currentWindow);
Process[] processList = Process.GetProcesses();
foreach (Process proc in processList)
{
string processID = Convert.ToString(proc.Id);
currentWindow.taskView.Items.Add(new ListViewItem(processID));
}
currentWindow.taskView.Refresh();
}
我在做什么错?
你有没有找到它?为什么这个区域的进程列表部分? – BugFinder
@BugFinder就像我说过的,我的耳朵真的很绿,所以我不确定跟踪是什么意思,我认为这是最好的地方 - 它应该在表单的.cs文件中吗? –
将您的ListView视图属性设置为“Details” – LocEngineer