本文介绍了传递DataGridView的参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要从VB6过渡到DotNet.
我正在研究用于导出DataGridView控件的通用代码.
如何将控件的引用传递给将值导出到Excel的例程?

I am going for the transition from VB6 to DotNet.
I am working on a generalized code to export DataGridView Control.
How can I pass the reference of the control to the routine exporting the values to Excel?

推荐答案

Private Sub WhatEver()
	ExportDateToExcel(myDataGridView)
End Sub
Private Sub ExportDataToExcel(dgv As DataGridView)
	Dim rows As DataGridViewRowCollection = dgv.Rows
End Sub


private Sub ExportDataToExcel(Byref dgv as DataGridView)
  'do work here
end sub



这篇关于传递DataGridView的参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 09:01