Created
April 28, 2011 01:24
-
-
Save mattbasta/945612 to your computer and use it in GitHub Desktop.
DVD selection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class frmDvd | |
Private myParent As frmMain | |
Private Sub frmCustomer_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated | |
Dim idx As Integer | |
Dim panel As ToolStripStatusLabel | |
idx = myParent.searchForPanel("DVDs") | |
If idx <> -1 Then | |
panel = myParent.sbrMain.Items(idx) | |
panel.BorderStyle = Border3DStyle.Sunken | |
panel.BackColor = Color.White | |
End If | |
End Sub | |
Private Sub frmCustomer_Deactivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Deactivate | |
Dim idx As Integer | |
Dim panel As ToolStripStatusLabel | |
idx = myParent.searchForPanel("DVDs") | |
panel = myParent.sbrMain.Items(idx) | |
panel.BorderStyle = Border3DStyle.Raised | |
panel.BackColor = Me.BackColor | |
End Sub | |
Private Sub frmCustomer_HandleDestroyed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.HandleDestroyed | |
With myParent | |
.mnuDvds.Enabled = True | |
.tbrbDvd.Enabled = True | |
.removePanel("DVDs") | |
.HandleClose() | |
End With | |
End Sub | |
Private Sub frmCustomer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load | |
myParent = Me.MdiParent | |
dvdQuery = "SELECT * FROM " & dvdtable | |
retrieveTable(dvdQuery, dtDvds) | |
dgv_DVD.DataSource = dtDvds | |
dgv_DVD.AutoResizeColumns() | |
End Sub | |
Private Sub mnuViewGenre_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles mnuViewGenre.Click | |
Dim search As String | |
search = InputBox("Please enter a Genre", "Genre", "ALL") | |
If search = "ALL" Or "all" Or "All" Then | |
dvdQuery = "SELECT * FROM " & dvdtable | |
Else | |
dvdQuery = "SELECT * FROM " & dvdtable & " WHERE Genre = """ & search & """"; | |
End If | |
retrieveTable(dvdQuery, dtDvds) | |
dgv_DVD.DataSource = dtDvds | |
dgv_DVD.AutoResizeColumns() | |
End Sub | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment