错误:无法将类型'string'隐式转换为'System.Windows.Forms.ColumnHeader [英] Error:Cannot implicitly convert type 'string' to 'System.Windows.Forms.ColumnHeader

查看:295
本文介绍了错误:无法将类型'string'隐式转换为'System.Windows.Forms.ColumnHeader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用ListView Control.I创建了4个列。当我尝试运行我的表单时,我收到了一个错误:

无法将类型'string'隐式转换为'System.Windows.Forms.ColumnHeader。



错误是在此Form.Designer.cs的代码片段中

Hi,

I am using ListView Control.I created 4 Columns .when i gave a try to run my form,I got an error:
"Cannot implicitly convert type 'string' to 'System.Windows.Forms.ColumnHeader."

The error is in this code snippet of Form.Designer.cs

this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(469, 359);
this.Controls.Add(this.listView1);
this.Name = "Form1";  ' --- here i got an error ---
this.Text = "ListView Demo Form";
this.ResumeLayout(false);



有谁可以解释这个错误?



问候,

Chaithu


Could anyone explain about this error?

Regards,
Chaithu

推荐答案

您的列表视图是否有名为Name的列或其他名称为Name的控件?尝试改变它,然后再去。看看有关类似问题的另一个论坛的链接。



http://bytes.com/topic/net/answers/602612-cannot-implicitly-convert-system-windows-forms-columnheader [ ^ ]



祝你好运!
Does your listview have a column named "Name" or some other control with the name "Name"? Try changing it and have another go. Have a look at the link to another forum with a similar question.

http://bytes.com/topic/net/answers/602612-cannot-implicitly-convert-system-windows-forms-columnheader[^]

Good luck!


听起来你只需要使用该Line中的Text属性。 />


希望这能解决您的问题。
It sounds like you just need to use the Text property in that Line.

Hope this will solve your problem.


这会给你一个肯定的想法......


这篇关于错误:无法将类型'string'隐式转换为'System.Windows.Forms.ColumnHeader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆