日期:2014-05-18 浏览次数:20968 次
public void setData(string time, string username,string name,string type,string leibie,string money,string moneylast ) { dataGridView1.Rows[rowIndex].Cells["Column1"].Value = time; dataGridView1.Rows[rowIndex].Cells["Column2"].Value = username; dataGridView1.Rows[rowIndex].Cells["Column3"].Value = name; dataGridView1.Rows[rowIndex].Cells["Column4"].Value = type; dataGridView1.Rows[rowIndex].Cells["Column5"].Value = leibie; dataGridView1.Rows[rowIndex].Cells["Column6"].Value = money; dataGridView1.Rows[rowIndex].Cells["Column7"].Value = moneylast; rowIndex++; }
Form2 mf = (Form2)this.Owner; mf.setData(System.DateTime.Now.ToString(), textBoxAccount.Text, textBoxName.Text, comboBoxString.Text, type, textBoxInitMoney.Text, textBoxInitMoney.Text);
public void setData(string time, string username, string name, string type, string leibie, string money, string moneylast) { int index = this.dataGridView1.Rows.Add(); dataGridView1.Rows[index].Cells["Column1"].Value = time; dataGridView1.Rows[index].Cells["Column2"].Value = username; dataGridView1.Rows[index].Cells["Column3"].Value = name; dataGridView1.Rows[index].Cells["Column4"].Value = type; dataGridView1.Rows[index].Cells["Column5"].Value = leibie; dataGridView1.Rows[index].Cells["Column6"].Value = money; dataGridView1.Rows[index].Cells["Column7"].Value = moneylast; }