Sabtu, 04 Februari 2017

Memindahkan Isi DataGridView Ke Textbox Ketika diklik

Private Sub dgv_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles dgv.MouseDoubleClick
        form_detail_buku.Show()
        Dim i As Integer
        i = Me.dgv.CurrentRow.Index
        With dgv.Rows.Item(i)
            Me.txt_id_buku.Text = .Cells(0).Value
            Me.txt_judul.Text = .Cells(1).Value
            Me.txt_halaman.Text = .Cells(2).Value
            Me.cmb_tahun.Text = .Cells(3).Value
            Me.lbl_path.Text = .Cells(4).Value
            Me.dtp_tanggal_beli.Value = .Cells(5).Value
            Me.txt_harga_beli.Text = .Cells(6).Value
            Me.txt_jumlah_buku.Text = .Cells(7).Value


        End With
        'frmTambahBarang.Show()
        'frmTambahBarang.Text = "Ubah Data Barang"
        'frmTambahBarang.btnSimpan.Text = "Perbarui"
        'Me.Close()
    End Sub

Tidak ada komentar:

Posting Komentar