C#打印richTextBoxPrintCtrl控件问题
发布网友
发布时间:2022-04-23 20:34
我来回答
共2个回答
热心网友
时间:2022-05-03 10:37
可将下面的代码放在一个button事件里
for (int n = 0; n < this.dgvEmployee.Rows.Count; n++)
{
this.dgvEmployee.Rows[n].Selected = true;//选择的行不断发生改变
this.dgvEmployee.CurrentCell = this.dgvEmployee.Rows[n].Cells[0];//改变当前活动的单元格触发事件;
this.dgvEmployee.CurrentCellChanged += new EventHandler(dgvEmployee_SelectionChanged);//单元格发生改变触发选择行发生改变;
richTextBoxPrintCtrl1.Text += "-------------------------------------------------------------------------- " + "\n" + this.lblId.Text + ":" + this.txtId.Text + "\n" + this.lblName.Text + ":" + this.txtName.Text+ "\n" + lblData.Text + ":" + dateTimeData.Text + "\n" + lblMarriage.Text + ":" + cboMarriage.Text + "\n" ;
}
然后在
private void mnuAllMess_Click_1(object sender, EventArgs e)
{
触发上面button事件
}
可以实现
热心网友
时间:2022-05-03 11:55
for 改 while看看