将form1窗口DataGridView选中值取出传给form2窗口中DataGridView

billlyh 2010-04-13 09:22:31
用vb.net2005做的c/s程序,
将form1窗口DataGridView选中值取出传给form2窗口中DataGridView
打算在form1用一个公共数组变量将选中的值保存起来,
这个数组作为form2中DataGridView的数据源,
大家来评价我这思路,
哪位高手能给出vb.net的代码我呀,我熟C#不熟vb

目前只能做到将form1窗口中的DataGridView选中值显示出来
Private Sub bt_add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_add.Click
For Each dr As DataGridViewRow In Me.DataGridView1.Rows
Dim cbx As DataGridViewCheckBoxCell = DirectCast(dr.Cells(0), DataGridViewCheckBoxCell)
If CBool(cbx.FormattedValue) Then
MessageBox.Show(dr.Cells(2).Value)
End If
Next
End Sub
...全文
88 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
billlyh1261 2010-04-14
  • 打赏
  • 举报
回复
VB.NET中有你要的答案

110,499

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧