Here is my code:
Public Class frmMain
Dim currMgr As CurrencyManager
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Loads data into the 'DsCompactDiscs.tblCompactDiscs' table.
Me.TblCompactDiscsTableAdapter.Fill(Me.DsCompactDiscs.tblCompactDiscs)
' Gets a reference to the CurrencyManager object.
currMgr = Me.BindingContext(DsCompactDiscs, "tblCompactDiscs")
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
' Advance to the next record in the table or display message to the user if last record is reached.
If currMgr.Position < (currMgr.Count - 1) Then
currMgr.Position += 1
Else
MessageBox.Show("No More Records.", "System Message", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
Me.Close()
End Sub
Private Sub btnPrev_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrev.Click
' Move to the previous row in the table or display a message to the user if first record is reached.
If currMgr.Position > 0 Then
currMgr.Position -= 1
Else
MessageBox.Show("First Record Reached.", "System Message", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
End Class
CDInventoryss.bmp (421.93K)
Number of downloads: 37

New Topic/Question
Reply




MultiQuote





|