我必须通过id
从 C# 中的一种形式到另一种形式。
我无法做到这一点。
C# 代码是:
private void btnedit_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow a in dataGridViewUnPaidList.Rows)
{
if (a.Cells[0].Value != null)
{
Convert.ToInt64(a.Cells[1].Value); // i have to pass this id in AddInvoice() form
AddInvoice ad = new AddInvoice();
ad.Show();
NonPaideData non = new NonPaideData();
non.Hide();
}
else
{
MessageBox.Show("Now Row Is Selected");
}
}
}
谁能告诉我我做错了什么?
建立财产AddInvoice
:
public long CellValue { get; set }
分配给它:
private void btnedit_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow a in dataGridViewUnPaidList.Rows)
{
if (a.Cells[0].Value != null)
{
AddInvoice ad = new AddInvoice();
ad.CellValue = Convert.ToInt64(a.Cells[1].Value);
ad.Show();
NonPaideData non = new NonPaideData();
non.Hide();
}
else
{
MessageBox.Show("Now Row Is Selected");
}
}
只需使用它AddInvoice
as CellValue
.
哦,如果这实际上是代码,我想你的意思可能是this.Hide();
而不是创建一个新的NonPaideData
并隐藏这一点。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)