C#windows窗体应用程序

public partial class AddForm : Form
{
private int intTemp;
private user use = new user();
public AddForm(int temp, user u)
{
intTemp = temp;
use= u;
InitializeComponent();
}
private RedoForm parentForm;
public RedoForm pForm
{
get
{
return parentForm;
}
set
{
parentForm = value;
}
}
然后调用RedoForm窗体的方法
pForm.load();
这是RedoForm中load的方法
public void load()
{
LJQLDataContext dc = new LJQLDataContext();
this.listView1.Clear();
foreach (var result in dc.user)
{
user u = (user)result;
ListViewItem lvi = new ListViewItem();

            lvi.Tag = u;
            lvi.Text = "编号:" + u.uID + "名称:" + u.uName;
            lvi.Name = u.uID;
            lvi.ImageIndex = 0;
            lvi.ToolTipText = "双击查看详细信息!";
            this.listView1.Items.Add(lvi);
        }
    }
            但调用报错,pForm未初始化,还要怎么初始化

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问