databaseobjects_demo_net.zip
Data
mysql_northwind.zip
Documentation
DatabaseObjects.chm
VB.NET
demo
Northwind
bin
AxInterop.SHDocVw.dll
DatabaseObjects.dll
Interop.SHDocVw.dll
Northwind.exe
NorthwindDatabase.dll
Northwind.vbproj.user
NorthwindDB
NorthwindDatabase.vbproj.user
source
Attributes
bin
DatabaseObjects.dll
Database
DatabaseObjects.vbproj.user
Misc
SQL
databaseobjects_demo_vb6.zip
mysql_northwind.zip
images
databaseobjects_classdiagram.jpg
logo.jpg
templates
VB6
demo
Northwind.vbg
Northwind
ControlAnchor.cls
frmMain.frm
frmMain.frx
frmOrder.frm
frmOrder.frx
frmProducts.frm
frmProducts.frx
frmProductSearch.frm
frmProductSearch.frx
frmProductSearchExtended.frm
frmProductSearchExtended.frx
frmSuppliers.frm
frmSuppliers.frx
Northwind.exe
northwind.RES
Northwind.vbp
NorthwindDB
Categories.cls
Category.cls
Data.bas
LateBoundObject.cls
NorthwindDatabase.cls
NorthwindDatabase.OBJ
NorthwindDB.dll
NorthwindDB.vbp
Order.cls
OrderDetail.cls
OrderDetails.cls
Orders.cls
Product.cls
Products.cls
ProductSearch.cls
Supplier.cls
Suppliers.cls
regsvr32.exe
source
bin
DatabaseObjects_vb6.dll
Database.cls
DBO.vbp
GlobalDatabase.cls
GlobalDatabaseObjects.cls
IDatabaseObject.cls
IDatabaseObjects.cls
IGlobalDatabaseObjects.cls
ISQLStatement.cls
modMisc.bas
SQLAlterTable.cls
SQLAutoIncrementValue.cls
SQLCondition.cls
SQLConditionFieldCompare.cls
SQLConditionInSelect.cls
SQLConditions.cls
SQLConditionSelect.cls
SQLCreateIndex.cls
SQLCreateTable.cls
SQLDelete.cls
SQLDropIndex.cls
SQLDropTable.cls
SQLFieldValue.cls
SQLFieldValues.cls
SQLIndexExists.cls
SQLIndexField.cls
SQLIndexFields.cls
SQLInsert.cls
SQLSelect.cls
SQLSelectField.cls
SQLSelectFields.cls
SQLSelectGroupByField.cls
SQLSelectGroupByFields.cls
SQLSelectOrderByField.cls
SQLSelectOrderByFields.cls
SQLSelectTable.cls
SQLSelectTableJoin.cls
SQLSelectTableJoinCondition.cls
SQLSelectTableJoinConditions.cls
SQLSelectTableJoins.cls
SQLSelectTables.cls
SQLTableExists.cls
SQLTableField.cls
SQLTableFields.cls
SQLUpdate.cls
SQLUpdateCopyField.cls
SQLUpdateCopyFields.cls
databaseobjects_src_net.zip
DatabaseObjects.dll
DatabaseObjects.vbproj.user
databaseobjects_src_vb6.zip
DatabaseObjects_vb6.dll
Database.cls
DBO.vbp
GlobalDatabase.cls
GlobalDatabaseObjects.cls
IDatabaseObject.cls
IDatabaseObjects.cls
IGlobalDatabaseObjects.cls
ISQLStatement.cls
modMisc.bas
SQLAlterTable.cls
SQLAutoIncrementValue.cls
SQLCondition.cls
SQLConditionFieldCompare.cls
SQLConditionInSelect.cls
SQLConditions.cls
SQLConditionSelect.cls
SQLCreateIndex.cls
SQLCreateTable.cls
SQLDelete.cls
SQLDropIndex.cls
SQLDropTable.cls
SQLFieldValue.cls
SQLFieldValues.cls
SQLIndexExists.cls
SQLIndexField.cls
SQLIndexFields.cls
SQLInsert.cls
SQLSelect.cls
SQLSelectField.cls
SQLSelectFields.cls
SQLSelectGroupByField.cls
SQLSelectGroupByFields.cls
SQLSelectOrderByField.cls
SQLSelectOrderByFields.cls
SQLSelectTable.cls
SQLSelectTableJoin.cls
SQLSelectTableJoinCondition.cls
SQLSelectTableJoinConditions.cls
SQLSelectTableJoins.cls
SQLSelectTables.cls
SQLTableExists.cls
SQLTableField.cls
SQLTableFields.cls
SQLUpdate.cls
SQLUpdateCopyField.cls
SQLUpdateCopyFields.cls
|
Option Strict Off
Option Explicit On
Imports NorthwindDatabase
Friend Class frmProducts
Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
If Disposing Then
If Not components Is Nothing Then
components.Dispose()
End If
End If
MyBase.Dispose(Disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
Public ToolTip1 As System.Windows.Forms.ToolTip
Public WithEvents cmdClose As System.Windows.Forms.Button
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents tvwCategories As System.Windows.Forms.TreeView
Friend WithEvents lvwProducts As System.Windows.Forms.ListView
Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader2 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader3 As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeader4 As System.Windows.Forms.ColumnHeader
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.cmdClose = New System.Windows.Forms.Button
Me.tvwCategories = New System.Windows.Forms.TreeView
Me.lvwProducts = New System.Windows.Forms.ListView
Me.ColumnHeader1 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader2 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader3 = New System.Windows.Forms.ColumnHeader
Me.ColumnHeader4 = New System.Windows.Forms.ColumnHeader
Me.SuspendLayout()
'
'cmdClose
'
Me.cmdClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.cmdClose.BackColor = System.Drawing.SystemColors.Control
Me.cmdClose.Cursor = System.Windows.Forms.Cursors.Default
Me.cmdClose.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.cmdClose.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmdClose.ForeColor = System.Drawing.SystemColors.ControlText
Me.cmdClose.Location = New System.Drawing.Point(617, 412)
Me.cmdClose.Name = "cmdClose"
Me.cmdClose.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cmdClose.Size = New System.Drawing.Size(89, 24)
Me.cmdClose.TabIndex = 2
Me.cmdClose.Text = "&Close"
'
'tvwCategories
'
Me.tvwCategories.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.tvwCategories.ImageIndex = -1
Me.tvwCategories.Location = New System.Drawing.Point(4, 4)
Me.tvwCategories.Name = "tvwCategories"
Me.tvwCategories.SelectedImageIndex = -1
Me.tvwCategories.Size = New System.Drawing.Size(220, 400)
Me.tvwCategories.TabIndex = 0
'
'lvwProducts
'
Me.lvwProducts.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lvwProducts.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2, Me.ColumnHeader3, Me.ColumnHeader4})
Me.lvwProducts.Location = New System.Drawing.Point(228, 4)
Me.lvwProducts.Name = "lvwProducts"
Me.lvwProducts.Size = New System.Drawing.Size(477, 398)
Me.lvwProducts.TabIndex = 1
Me.lvwProducts.View = System.Windows.Forms.View.Details
'
'ColumnHeader1
'
Me.ColumnHeader1.Text = "Name"
Me.ColumnHeader1.Width = 120
'
'ColumnHeader2
'
Me.ColumnHeader2.Text = "Supplier"
Me.ColumnHeader2.Width = 120
'
'ColumnHeader3
'
Me.ColumnHeader3.Text = "Unit Price"
Me.ColumnHeader3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
Me.ColumnHeader3.Width = 70
'
'ColumnHeader4
'
Me.ColumnHeader4.Text = "Quantity Per Unit"
Me.ColumnHeader4.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
Me.ColumnHeader4.Width = 100
'
'frmProducts
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.Control
Me.CancelButton = Me.cmdClose
Me.ClientSize = New System.Drawing.Size(710, 447)
Me.Controls.Add(Me.lvwProducts)
Me.Controls.Add(Me.tvwCategories)
Me.Controls.Add(Me.cmdClose)
Me.Cursor = System.Windows.Forms.Cursors.Default
Me.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Location = New System.Drawing.Point(3, 29)
Me.MinimizeBox = False
Me.Name = "frmProducts"
Me.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Products"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub LoadCategories()
Dim objCategory As Category
Dim objRoot As TreeNode
With Me.tvwCategories.Nodes
objRoot = .Add("All")
For Each objCategory In NorthwindDB.Categories
objRoot.Nodes.Add(objCategory.Name)
Next
objRoot.Expand()
End With
End Sub
Private Sub LoadProducts(ByVal objProducts As Products)
Dim objProduct As Product
With Me.lvwProducts.Items
.Clear()
For Each objProduct In objProducts
With .Add(objProduct.Name)
.SubItems.Add(objProduct.Supplier.Name)
.SubItems.Add(objProduct.UnitPrice)
.SubItems.Add(objProduct.QuantityPerUnit)
End With
Next
End With
End Sub
Private Sub frmProducts_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
LoadCategories()
LoadProducts(NorthwindDB.Products)
End Sub
Private Sub cmdClose_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdClose.Click
Me.Close()
End Sub
Private Sub tvwCategories_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles tvwCategories.Click
End Sub
Private Sub tvwCategories_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvwCategories.AfterSelect
If e.Node.Parent Is Nothing Then
LoadProducts(NorthwindDB.Products)
Else
LoadProducts(NorthwindDB.Categories(e.Node.Text).Products)
End If
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of use and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here