You are on page 1of 2

Private Sub DgwMasterResep_MouseDoubleClick(ByVal sender As Object, ByVal e As

System.Windows.Forms.MouseEventArgs) Handles DgwMasterResep.MouseDoubleClick

Dim xrowpos As Integer

Dim xjmlrecord, xcounter As Integer

Dim xketemu As Boolean

'Number of record

xjmlrecord = dsMaster.Tables("dtListResep").Rows.Count

'DataGrid Current Cell (after keypress enter)

xrowpos = DgwMasterResep.CurrentCell.RowIndex

'tabel resep

xcounter = 0

xketemu = False

While ((xcounter <= xjmlrecord) And (xketemu = False))

If (xcounter = xrowpos) Then

TxtKodeResep.Text = dsMaster.Tables("dtListResep").Rows(xcounter).Item(0)

TxtNamaResep.Text = dsMaster.Tables("dtListResep").Rows(xcounter).Item(1)

TxtJenisBenang.Text =
dsMaster.Tables("dtListResep").Rows(xcounter).Item(2)

xketemu = True

End If

xcounter = xcounter + 1

End While

If (xketemu = True) Then

BtnTambah.Enabled = False

BtnUbah.Enabled = True

PanelBtn2.Enabled = True

Me.BtnUbah.Focus()
End If

End Sub

You might also like