本文介绍了如何在不打开新winform的情况下将值从gridview传递到打开的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 嘿伙计们, 我有一点问题,因为我是个书呆子。我有这个任务要做。 i有一个表单来查找客户详细信息,并在gridview上双击所选客户,其详细信息应该传递给打开winform,但据我所知只有frm.show或frm.showdialogue打开了一个全新的winform,这不是我想要的。请帮帮我.......谢谢 i这里的代码如下 Form_OrderEntry frm = new Form_OrderEntry(); frm.txtcustomercode.Text = dataGridView1.CurrentRow.Cells [ 0 ]。Value.ToString(); frm.txtcustomername.Text = dataGridView1.CurrentRow.Cells [ 1 ]。Value.ToString(); frm.Visible = true ; 此 .Close(); form_orderentry是我的主要表单,它应该在其customercode和name文本框中获取值。但是我得到了一个全新的窗口。解决方案 Hey guys,i have a little problem as i m a nerd. i have this task to do.i have a form to find the customer details and on the double click of the selected customer on gridview, its details should pass into the opened winform but as i know only frm.show or frm.showdialogue which opens a complete new winform which is not what i have wanted . please help me out.......thanksi have a code here like this Form_OrderEntry frm = new Form_OrderEntry(); frm.txtcustomercode.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString(); frm.txtcustomername.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString(); frm.Visible = true; this.Close();form_orderentry is my main form and it should get values in its customercode and name textbox. but i get a complete new window. 解决方案 这篇关于如何在不打开新winform的情况下将值从gridview传递到打开的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-29 01:18