![](/img/trans.png)
[英]Passing Values from (DataGridView1_Click) in a Form to another sub in another form
[英]Passing a datagridview from another form
將數據從datagridview顯示為另一種形式,我嘗試了不同的方法,但是它們似乎都不起作用,所以這是我嘗試的方法。
Private Sub DataGridView1_Click(sender As Object, e As EventArgs) Handles DataGridView1.Click
Dim frm As New EvidentnaLista
frm.TextBoxMaticen.Text = DataGridView1.CurrentRow.Cells(0).Value.ToString()
frm.TextBoxOddelenie.Text = DataGridView1.CurrentRow.Cells(1).Value.ToString()
frm.TextBoxPrezimeIimeNaNositel.Text = DataGridView1.CurrentRow.Cells(2).Value.ToString()
frm.TextBoxLekLiceIAdresa.Text = DataGridView1.CurrentRow.Cells(3).Value.ToString()
frm.TextBoxSrodstvo.Text = DataGridView1.CurrentRow.Cells(4).Value.ToString()
frm.TextBoxGradSelo.Text = DataGridView1.CurrentRow.Cells(5).Value.ToString()
frm.TextBoxOpstina.Text = DataGridView1.CurrentRow.Cells(6).Value.ToString()
frm.TextBoxDrzava.Text = DataGridView1.CurrentRow.Cells(7).Value.ToString()
frm.TextBoxStalnoMesto.Text = DataGridView1.CurrentRow.Cells(8).Value.ToString()
frm.TextBoxBrojNaLicna.Text = DataGridView1.CurrentRow.Cells(9).Value.ToString()
frm.TextBoxZanimanje.Text = DataGridView1.CurrentRow.Cells(10).Value.ToString()
frm.TextBoxKadeEVraboten.Text = DataGridView1.CurrentRow.Cells(11).Value.ToString()
frm.TextBoxBrojNaZdrKniska.Text = DataGridView1.CurrentRow.Cells(12).Value.ToString()
frm.TextBoxBrojNaUpat.Text = DataGridView1.CurrentRow.Cells(13).Value.ToString()
frm.TextBoxMkbBroj.Text = DataGridView1.CurrentRow.Cells(14).Value.ToString()
frm.TextBoxPodatociZaBlz.Text = DataGridView1.CurrentRow.Cells(15).Value.ToString()
'frm.TextBoxDatum.Text = selred.Cells(17).Value.ToString
End Sub
End Class
表格未顯示我的數據
我只需要frm.show來顯示表格
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.