简单的问题,高手进来帮小弟一把~!!!!
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(275): 运算符“==”无法应用于“System.Windows.Forms.ColumnHeader”和“string”类型的操作数
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(268): 与“System.Windows.Forms.ListViewItem.ListViewSubItem.ListViewSubItem(System.Windows.Forms.ListViewItem, string)”最匹配的重载方法具有一些无效参数
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(245): 名称“sort”在类或命名空间“个人名片夹.Form1”中不存在
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(248): 名称“sort”在类或命名空间“个人名片夹.Form1”中不存在
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(253): 名称“sort”在类或命名空间“个人名片夹.Form1”中不存在
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(250): 名称“sort”在类或命名空间“个人名片夹.Form1”中不存在
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(268): 参数“2” : 无法从“System.Windows.Forms.ColumnHeader”转换为“string”
不知道这些错误是怎么回事,怎么解决。高手指点一下 ,叩谢了!!!!
部分源代码是这样子的:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace 个人名片夹
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ColumnHeader name;
private System.Windows.Forms.ColumnHeader phone;
private System.Windows.Forms.ColumnHeader email;
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void listView1_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
{
if (sort==false)
{
this.listView1.Sorting=SortOrder.Ascending;
sort=true;
}
else if(sort==true)
{
this.listView1.Sorting=SortOrder.Descending;
sort=false;
}
}
private void button1_Click(object sender, System.EventArgs e)
{
String name=this.textBox1.Text;
String photo=this.textBox2.Text;
String email=this.textBox3.Text;
if (name!=""&photo!=""&email!="")
{
int number=this.listView1.Items.Count;
ListViewItem lvItem= new ListViewItem(new ListViewItem.ListViewSubItem[]
{
new ListViewItem.ListViewSubItem(null,name),
new ListViewItem.ListViewSubItem(null,phone),
new ListViewItem.ListViewSubItem(null,email)
},-1);
this.listView1.Items.Insert(number,lvItem);
this.listView1.Items[number].ImageIndex=0;
}
else if(name==""){MessageBox.Show("请输入姓名","警告");}
else if(phone==""){MessageBox.Show("请输入电话号码","警告");}
else if(email==""){MessageBox.Show("请输入邮件地址","警告");}
}
private void button2_Click(object sender, System.EventArgs e)
{
this.textBox1.Text="";
this.textBox2.Text="";
this.textBox3.Text="";
}
private void button3_Click(object sender, System.EventArgs e)
{
ListViewItem li=this.listView1.SelectedItems[0];
this.listView1.Items.Remove(li);
}
}
}
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(268): 与“System.Windows.Forms.ListViewItem.ListViewSubItem.ListViewSubItem(System.Windows.Forms.ListViewItem, string)”最匹配的重载方法具有一些无效参数
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(245): 名称“sort”在类或命名空间“个人名片夹.Form1”中不存在
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(248): 名称“sort”在类或命名空间“个人名片夹.Form1”中不存在
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(253): 名称“sort”在类或命名空间“个人名片夹.Form1”中不存在
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(250): 名称“sort”在类或命名空间“个人名片夹.Form1”中不存在
C:\Documents and Settings\miller.net\My Documents\Visual Studio Projects\个人名片夹\Form1.cs(268): 参数“2” : 无法从“System.Windows.Forms.ColumnHeader”转换为“string”
不知道这些错误是怎么回事,怎么解决。高手指点一下 ,叩谢了!!!!
部分源代码是这样子的:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace 个人名片夹
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ColumnHeader name;
private System.Windows.Forms.ColumnHeader phone;
private System.Windows.Forms.ColumnHeader email;
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void listView1_ColumnClick(object sender, System.Windows.Forms.ColumnClickEventArgs e)
{
if (sort==false)
{
this.listView1.Sorting=SortOrder.Ascending;
sort=true;
}
else if(sort==true)
{
this.listView1.Sorting=SortOrder.Descending;
sort=false;
}
}
private void button1_Click(object sender, System.EventArgs e)
{
String name=this.textBox1.Text;
String photo=this.textBox2.Text;
String email=this.textBox3.Text;
if (name!=""&photo!=""&email!="")
{
int number=this.listView1.Items.Count;
ListViewItem lvItem= new ListViewItem(new ListViewItem.ListViewSubItem[]
{
new ListViewItem.ListViewSubItem(null,name),
new ListViewItem.ListViewSubItem(null,phone),
new ListViewItem.ListViewSubItem(null,email)
},-1);
this.listView1.Items.Insert(number,lvItem);
this.listView1.Items[number].ImageIndex=0;
}
else if(name==""){MessageBox.Show("请输入姓名","警告");}
else if(phone==""){MessageBox.Show("请输入电话号码","警告");}
else if(email==""){MessageBox.Show("请输入邮件地址","警告");}
}
private void button2_Click(object sender, System.EventArgs e)
{
this.textBox1.Text="";
this.textBox2.Text="";
this.textBox3.Text="";
}
private void button3_Click(object sender, System.EventArgs e)
{
ListViewItem li=this.listView1.SelectedItems[0];
this.listView1.Items.Remove(li);
}
}
}
...全文
相关推荐
《鼠小弟的生日》绘本故事PPT模板
《鼠小弟的生日》绘本故事PPT 送给鼠小弟的礼物终于完成了。今天是鼠小弟的生日。我得把礼物漂漂亮亮的包上。干什么呢,鼠小妹?送给鼠小弟的礼物怎么也包不好。我帮你吧。嗯,太难了。你们干什么呢?给鼠小弟送的礼物,我们怎么也包不好呢。我来帮忙吧,嗯
《鼠小弟-想吃苹果的鼠小弟 (2).ppt
《鼠小弟-想吃苹果的鼠小弟 (2).ppt
可爱的鼠小弟05鼠小弟,鼠小弟_精美学习课件ppt
可爱的鼠小弟05鼠小弟,鼠小弟_精美学习课件ppt
紧急求助关于SVM调用问题-SVMcgForRegress.m
紧急求助关于SVM调用问题-SVMcgForRegress.m 每次调用svm都会报错导致程序中断,求大神能帮调试下,小弟已经弄1下午了……也求助过老师TOT都没成功~谢谢了先
软件工程导论期末试题
1、瀑布模型把软件生命周期划分为八个阶段:问题的定义、可行性研究、软件需求分析、系统总体设计、详细设计、编码、测试和运行、维护。30.科学工程计算需要大量的标准库函数,以便处理复杂的数值计算,可供选择的语言有:( FORTRAN语言)、PASCAL语言、C语言和PL/1语言。2、从结构化的瀑布模型看,在它的生命周期中的八个阶段中,下面的几个选项中哪个环节出错,对软件的影响最大(C )。3、在结构化的瀑布模型中,哪一个阶段定义的标准将成为软件测试中的系统测试阶段的目标(A )。


