ctrlDBExplorer.vb

 Imports System.Data.OleDb
Imports System.IO
Public Class DBExplorer
    Inherits System.Windows.Forms.UserControl

#Region "Author"
    '************************************************************
    'Author : Petkovic Vladimir (VBProgrammer)  ................*
    'Country:Serbia                        .....................*
    'Date Create : 30/01/2004              .....................*
    'Email:petkov73@hotmail.com             ....................*                                        
    'Theme: DBWindowsExplorer ............................*                 
    '************************************************************
#End Region

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()
        Me.SetStyle(ControlStyles.ResizeRedraw, True)
        Me.SetStyle(ControlStyles.UserPaint, True)
        'Add any initialization after the InitializeComponent() call

    End Sub

    'UserControl1 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

    '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 Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents Pnl_LV As System.Windows.Forms.Panel
    Friend WithEvents Img As System.Windows.Forms.ImageList
    Friend WithEvents SB As System.Windows.Forms.StatusBar
    Friend WithEvents Panel3 As System.Windows.Forms.Panel
    Friend WithEvents TV As System.Windows.Forms.TreeView
    Friend WithEvents Splitter1 As System.Windows.Forms.Splitter
    Friend WithEvents Panel4 As System.Windows.Forms.Panel
    Friend WithEvents PB As System.Windows.Forms.ProgressBar
    Friend WithEvents LV_Filter As System.Windows.Forms.ListView
    Friend WithEvents Splitter2 As System.Windows.Forms.Splitter
    Friend WithEvents LV As System.Windows.Forms.ListView
    Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(DBExplorer))
        Me.Panel1 = New System.Windows.Forms.Panel()
        Me.Panel2 = New System.Windows.Forms.Panel()
        Me.Pnl_LV = New System.Windows.Forms.Panel()
        Me.Panel4 = New System.Windows.Forms.Panel()
        Me.LV = New System.Windows.Forms.ListView()
        Me.Img = New System.Windows.Forms.ImageList(Me.components)
        Me.Splitter2 = New System.Windows.Forms.Splitter()
        Me.LV_Filter = New System.Windows.Forms.ListView()
        Me.Splitter1 = New System.Windows.Forms.Splitter()
        Me.TV = New System.Windows.Forms.TreeView()
        Me.Panel3 = New System.Windows.Forms.Panel()
        Me.PB = New System.Windows.Forms.ProgressBar()
        Me.SB = New System.Windows.Forms.StatusBar()
        Me.MenuItem1 = New System.Windows.Forms.MenuItem()
        Me.Panel1.SuspendLayout()
        Me.Panel2.SuspendLayout()
        Me.Pnl_LV.SuspendLayout()
        Me.Panel4.SuspendLayout()
        Me.Panel3.SuspendLayout()
        Me.SuspendLayout()
        '
        'Panel1
        '
        Me.Panel1.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel2, Me.SB})
        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(264, 150)
        Me.Panel1.TabIndex = 2
        '
        'Panel2
        '
        Me.Panel2.Controls.AddRange(New System.Windows.Forms.Control() {Me.Pnl_LV})
        Me.Panel2.Dock = System.Windows.Forms.DockStyle.Fill
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(264, 128)
        Me.Panel2.TabIndex = 1
        '
        'Pnl_LV
        '
        Me.Pnl_LV.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel4, Me.Splitter1, Me.TV, Me.Panel3})
        Me.Pnl_LV.Dock = System.Windows.Forms.DockStyle.Fill
        Me.Pnl_LV.Name = "Pnl_LV"
        Me.Pnl_LV.Size = New System.Drawing.Size(264, 128)
        Me.Pnl_LV.TabIndex = 2
        '
        'Panel4
        '
        Me.Panel4.Controls.AddRange(New System.Windows.Forms.Control() {Me.LV, Me.Splitter2, Me.LV_Filter})
        Me.Panel4.Dock = System.Windows.Forms.DockStyle.Fill
        Me.Panel4.Location = New System.Drawing.Point(152, 16)
        Me.Panel4.Name = "Panel4"
        Me.Panel4.Size = New System.Drawing.Size(112, 112)
        Me.Panel4.TabIndex = 6
        '
        'LV
        '
        Me.LV.AllowColumnReorder = True
        Me.LV.BackColor = System.Drawing.Color.WhiteSmoke
        Me.LV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.LV.Dock = System.Windows.Forms.DockStyle.Fill
        Me.LV.FullRowSelect = True
        Me.LV.GridLines = True
        Me.LV.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable
        Me.LV.LargeImageList = Me.Img
        Me.LV.MultiSelect = False
        Me.LV.Name = "LV"
        Me.LV.Size = New System.Drawing.Size(112, 72)
        Me.LV.SmallImageList = Me.Img
        Me.LV.StateImageList = Me.Img
        Me.LV.TabIndex = 2
        Me.LV.View = System.Windows.Forms.View.Details
        '
        'Img
        '
        Me.Img.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit
        Me.Img.ImageSize = New System.Drawing.Size(16, 16)
        Me.Img.ImageStream = CType(resources.GetObject("Img.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.Img.TransparentColor = System.Drawing.Color.Transparent
        '
        'Splitter2
        '
        Me.Splitter2.Dock = System.Windows.Forms.DockStyle.Bottom
        Me.Splitter2.Location = New System.Drawing.Point(0, 72)
        Me.Splitter2.Name = "Splitter2"
        Me.Splitter2.Size = New System.Drawing.Size(112, 8)
        Me.Splitter2.TabIndex = 1
        Me.Splitter2.TabStop = False
        '
        'LV_Filter
        '
        Me.LV_Filter.AllowColumnReorder = True
        Me.LV_Filter.BackColor = System.Drawing.Color.WhiteSmoke
        Me.LV_Filter.Dock = System.Windows.Forms.DockStyle.Bottom
        Me.LV_Filter.ForeColor = System.Drawing.Color.DarkRed
        Me.LV_Filter.FullRowSelect = True
        Me.LV_Filter.GridLines = True
        Me.LV_Filter.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable
        Me.LV_Filter.LargeImageList = Me.Img
        Me.LV_Filter.Location = New System.Drawing.Point(0, 80)
        Me.LV_Filter.Name = "LV_Filter"
        Me.LV_Filter.Size = New System.Drawing.Size(112, 32)
        Me.LV_Filter.SmallImageList = Me.Img
        Me.LV_Filter.StateImageList = Me.Img
        Me.LV_Filter.TabIndex = 0
        Me.LV_Filter.View = System.Windows.Forms.View.Details
        '
        'Splitter1
        '
        Me.Splitter1.Location = New System.Drawing.Point(150, 16)
        Me.Splitter1.Name = "Splitter1"
        Me.Splitter1.Size = New System.Drawing.Size(2, 112)
        Me.Splitter1.TabIndex = 5
        Me.Splitter1.TabStop = False
        '
        'TV
        '
        Me.TV.BackColor = System.Drawing.Color.WhiteSmoke
        Me.TV.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.TV.CheckBoxes = True
        Me.TV.Dock = System.Windows.Forms.DockStyle.Left
        Me.TV.FullRowSelect = True
        Me.TV.ImageList = Me.Img
        Me.TV.Location = New System.Drawing.Point(0, 16)
        Me.TV.Name = "TV"
        Me.TV.Size = New System.Drawing.Size(150, 112)
        Me.TV.TabIndex = 4
        '
        'Panel3
        '
        Me.Panel3.Controls.AddRange(New System.Windows.Forms.Control() {Me.PB})
        Me.Panel3.Dock = System.Windows.Forms.DockStyle.Top
        Me.Panel3.Name = "Panel3"
        Me.Panel3.Size = New System.Drawing.Size(264, 16)
        Me.Panel3.TabIndex = 3
        '
        'PB
        '
        Me.PB.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right)
        Me.PB.Location = New System.Drawing.Point(0, 1)
        Me.PB.Name = "PB"
        Me.PB.Size = New System.Drawing.Size(264, 13)
        Me.PB.TabIndex = 0
        '
        'SB
        '
        Me.SB.Location = New System.Drawing.Point(0, 128)
        Me.SB.Name = "SB"
        Me.SB.ShowPanels = True
        Me.SB.Size = New System.Drawing.Size(264, 22)
        Me.SB.TabIndex = 0
        '
        'MenuItem1
        '
        Me.MenuItem1.Index = -1
        Me.MenuItem1.Text = "BackColor"
        '
        'DBExplorer
        '
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Panel1})
        Me.Name = "DBExplorer"
        Me.Size = New System.Drawing.Size(264, 150)
        Me.Panel1.ResumeLayout(False)
        Me.Panel2.ResumeLayout(False)
        Me.Pnl_LV.ResumeLayout(False)
        Me.Panel4.ResumeLayout(False)
        Me.Panel3.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region
#Region "User Control"
    Private Const C = ControlChars.CrLf
#Region "Events"
    Public Event EV_DataBase_Changed(ByVal New_DataBase_Path As String)

#End Region
#Region "Members Variable"
    Private mConnection_String As String
    Private mDataBase_Path As String
    Private mProvider As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source="
    Private mDataBase_Collection() As DataSet
    Private mDB_Current As DataSet
    Private mDT_Current As DataTable
    Private mTables_Names() As String
    Private mFrmDetail As New Form_Detail()
    Private mFrmFilter As Form_Filter
    Private mTemporary_ColumnHeader As New Hashtable()
    Private mPreskoci As Boolean = True
    Private mTempLV_ColumnCount, mPosition As Byte
#End Region
#Region "Property"
#Region "DataBase Path"
    Public Property DataBase_Path() As String
        Get
            Return Me.mDataBase_Path
        End Get
        Set(ByVal Value As String)
            Me.mDataBase_Path = Value
            RaiseEvent EV_DataBase_Changed(Value)
            mConnection_String = mProvider & Value
            If Value = "" Then Exit Property
            mTables_Names = GetDatabaseTables(mConnection_String)
            Fill_DataBases()
            With SB.Panels
                .Add("Database Path : " & Me.mDataBase_Path)
                .Item(0).Width = 500
                .Add("")
                .Item(1).Width = 150
                .Add("")
                .Item(2).Width = 200
                .Add("")
                .Item(3).Width = 200
            End With
        End Set
    End Property
#End Region
#End Region
#Region "Fill_DataBases"
    Private Sub Fill_DataBases()
        Dim str_Select As String
        Dim DA As OleDbDataAdapter
        Dim Cmd_Select As OleDbCommand
        Dim Conn As OleDbConnection
        Dim j As Byte
        Dim i As Integer
        Try
            Conn = New OleDbConnection(Me.mConnection_String)
            mDB_Current = New DataSet()
            Dim FrmLoad_Status As New Form_Load()
            For j = 0 To Me.mTables_Names.GetUpperBound(0) - 1
                str_Select = "Select * From " & "[" & Me.mTables_Names(j) & "]"
                Cmd_Select = New OleDbCommand(str_Select, Conn)
                DA = New OleDbDataAdapter(Cmd_Select)
                DA.Fill(Me.mDB_Current, mTables_Names(j))
                With FrmLoad_Status
                    .Text = mTables_Names(j) & "..."
                    .lblInfo.Text = "Load " & mTables_Names(j) & " ..."
                    .PB.Maximum = Me.mDB_Current.Tables(j).Rows.Count
                    FrmLoad_Status.Show()
                    FrmLoad_Status.Refresh()
                    For i = 0 To Me.mDB_Current.Tables(j).Rows.Count - 1
                        .PB.Value = .PB.Value + 1
                    Next
                    .PB.Value = 0
                End With
            Next
            FrmLoad_Status.Dispose()
            mDB_Current.DataSetName = Path.GetFileNameWithoutExtension(Me.DataBase_Path)
            TV.Nodes.Add(mDB_Current.DataSetName)
            TV.Nodes(0).ImageIndex = 2
            TV.Nodes(0).SelectedImageIndex = 2
            TV.Nodes(0).Tag = "DataBase"
            Fill_TreeView(mDB_Current)
        Catch exp As Exception
            MessageBox.Show(exp.Message & C & exp.Source & C & exp.TargetSite.ToString)
        End Try
    End Sub
#End Region
#Region "Scaning Database Tables"
    Function GetDatabaseTables(ByVal connString As String) As String()
        Dim cn As OleDbConnection
        Try
            cn = New OleDbConnection(connString)
            cn.Open()
            Dim dt As DataTable = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "TABLE"})
            cn.Close()
            Dim tables(dt.Rows.Count - 1) As String
            Dim i As Integer

            For i = 0 To dt.Rows.Count - 1
                tables(i) = dt.Rows(i)(2)
            Next
            Return tables
        Catch exp As Exception
            MessageBox.Show(exp.Message & C & exp.Source & C & exp.TargetSite.ToString)
        Finally
            cn.Dispose()
        End Try
    End Function

#End Region
#End Region
#Region "TreeView"
#Region "Populate TreeView"
    Private Sub Fill_TreeView(ByVal DataBase As DataSet)
        Dim Num_Tables = DataBase.Tables.Count
        Dim Num_Column As Byte
        Dim j, k As Byte
        Try
            With Me.TV
                For j = 0 To Num_Tables - 1
                    .Nodes(0).Nodes.Add(DataBase.Tables(j).TableName)
                    .Nodes(0).Nodes(j).Tag = "Tables"
                    .Nodes(0).Nodes(j).ImageIndex = 1
                    .Nodes(0).Nodes(j).SelectedImageIndex = 1
                    Num_Column = DataBase.Tables(j).Columns.Count
                    With .Nodes(0)
                        For k = 0 To Num_Column - 1
                            .Nodes(j).Nodes.Add(DataBase.Tables(j).Columns(k).ColumnName)
                            .Nodes(j).Nodes(k).Tag = "Column"
                            .Nodes(j).Nodes(k).ImageIndex = 0
                        Next
                    End With
                Next
            End With
        Catch exp As Exception
            MessageBox.Show(exp.Message & C & exp.Source & C & exp.TargetSite.ToString)
        End Try
    End Sub
#End Region
#Region "TreeView Events"
    Private Sub TV_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TV.AfterSelect
        Dim ND As TreeNode
        Dim ChldND As TreeNode
        Dim j As Byte
        Select Case e.Node.Tag
            Case "DataBases"
            Case "Tables"
                mTemporary_ColumnHeader.Clear()
                Me.mDT_Current = Me.mDB_Current.Tables(e.Node.Text)
                With Me.SB
                    .Panels(1).Text = ""
                    .Panels(1).Text = "Table Name : " & e.Node.Text
                    .Panels(2).Text = "Recordcount : " & Me.mDT_Current.Rows.Count
                    .Panels(3).Text = "Filter Recordcount :"
                End With
                Fill_ListView(Me.mDB_Current.Tables(e.Node.Text), LV)
                Dim NumChilde As Byte = e.Node.GetNodeCount(False)
                mPreskoci = True
                For Each ND In TV.Nodes(0).Nodes
                    If ND.Text = e.Node.Text Then
                        ND.Checked = True
                        For Each ChldND In ND.Nodes
                            ChldND.Checked = True
                        Next
                    Else
                        ND.Checked = False
                        For Each ChldND In ND.Nodes
                            ChldND.Checked = False
                        Next
                    End If
                Next
            Case "Column"
        End Select
        mPreskoci = False
    End Sub

    Private Sub TV_AfterCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TV.AfterCheck
        Try
            If mPreskoci = False Then
                If e.Node.Tag = "Column" Then
                    If Me.mDT_Current.TableName = e.Node.Parent.Text Then
                        Dim ColumnFor_Remove As ColumnHeader
                        mTempLV_ColumnCount = Temporary_LV_ColumnCount(e.Node.Parent)
                        If e.Node.Checked = True Then
                            If e.Node.Index <= mTempLV_ColumnCount Then
                                mPosition = e.Node.Index
                            Else
                                mPosition = mTempLV_ColumnCount - 1
                            End If
                            LV.Columns.Insert(LV.Columns.Count, mTemporary_ColumnHeader(e.Node.Text))
                            mTemporary_ColumnHeader.Remove(e.Node.Text)
                        Else
                            Dim Ind As Byte
                            For Each ColumnFor_Remove In LV.Columns
                                If ColumnFor_Remove.Text = e.Node.Text Then
                                    Ind = ColumnFor_Remove.Index
                                End If
                            Next
                            mTemporary_ColumnHeader.Add(e.Node.Text, LV.Columns(Ind))
                            LV.Columns.RemoveAt(Ind)
                        End If
                    End If
                End If
            End If

        Catch exp As Exception
            MessageBox.Show(exp.Message & C & exp.Source & C & exp.TargetSite.ToString)
        End Try
    End Sub

    Private Sub TV_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles TV.DoubleClick
        Dim DA As OleDbDataAdapter
        Try
            If TV.SelectedNode.Tag = "Column" Then
                If Me.mDT_Current.TableName = TV.SelectedNode.Parent.Text Then
                    Dim Table_Name As String
                    Dim Operation() As String
                    mFrmFilter = New Form_Filter()
                    Select Case mDT_Current.Columns(TV.SelectedNode.Text).DataType.ToString
                        Case "System.Int16", "System.Int32", "System.Int64", "System.Integer", "System.Short", "System.Byte", "System.Decimal", "System.Currency"
                            ReDim Operation(4)
                            Operation(0) = "<="
                            Operation(1) = "<"
                            Operation(2) = "="
                            Operation(3) = ">="
                            Operation(4) = ">"
                            mFrmFilter.Tag = "Number"
                        Case "System.String"
                            ReDim Operation(2)
                            Operation(0) = "="
                            Operation(1) = "Like"
                            Operation(2) = "Not Like"
                            mFrmFilter.Tag = "String"
                        Case "System.DateTime"
                            ReDim Operation(5)
                            Operation(0) = "<="
                            Operation(1) = "<"
                            Operation(2) = "="
                            Operation(3) = ">="
                            Operation(4) = ">"
                            Operation(5) = "Between"
                            mFrmFilter.Tag = "Date"
                        Case "System.Boolean"
                            ReDim Operation(0)
                            Operation(0) = "="
                            'Operation(1) = "False"
                            'Operation(2) = "Not"
                            mFrmFilter.Tag = "Boolean"
                    End Select
                    'MsgBox(Me.mDT_Current.Columns(TV.SelectedNode.Text).DataType.ToString)
                    With mFrmFilter
                        .Text = ""
                        .GB.Text = ""
                        .lblColumn.Text = ""
                        .cmbOperation.Items.Clear()
                        .Text = "Filtering " & TV.SelectedNode.Parent.Text & "..."
                        .GB.Text = TV.SelectedNode.Parent.Text
                        .lblColumn.Text = TV.SelectedNode.Text
                        Dim j As Byte
                        For j = 0 To Operation.GetUpperBound(0)
                            .cmbOperation.Items.Add(Operation(j))
                        Next
                        .ShowDialog()
                        If .strSelect = "" Then
                            Exit Sub
                        Else
                            'Akcija
                            'MsgBox(.strSelect)
                            DA = New OleDbDataAdapter(.strSelect, Me.mConnection_String)
                            Dim DT As New DataTable()
                            DA.Fill(DT)
                            ' MsgBox(DT.Rows.Count)

                            Me.Fill_ListView(DT, LV_Filter)
                            SB.Panels(3).Text = "Recordcount Filter : " & Me.LV_Filter.Items.Count
                            DA.Dispose()
                            DT.Dispose()
                        End If
                    End With
                End If
            End If
        Catch exp As Exception
            MessageBox.Show(exp.Message & C & exp.Source & C & exp.TargetSite.ToString)
        End Try
    End Sub

#End Region
#End Region
#Region "ListView"
#Region "Populate ListView"
    Private Overloads Sub Fill_ListView(ByVal DT As DataTable, ByVal listview As ListView)
        Dim j As Byte
        Dim i As Integer
        PB.Maximum = DT.Rows.Count
        Try
            With listview

                .Clear()
                .Columns.Clear()
                For j = 0 To DT.Columns.Count - 1
                    listview.Columns.Add(DT.Columns(j).ColumnName, 200, HorizontalAlignment.Left)
                Next
                For i = 0 To DT.Rows.Count - 1
                    .Items.Add(DT.Rows(i).Item(0).ToString)
                    .Items(i).StateImageIndex = 3
                    For j = 1 To DT.Columns.Count - 1
                        .Items(i).SubItems.Add(DT.Rows(i).Item(j).ToString)
                        .Items(i).ImageIndex = 36
                    Next
                    PB.Value = PB.Value + 1
                Next
            End With
            PB.Value = 0
        Catch exp As Exception
            MessageBox.Show(exp.Message & C & exp.Source & exp.TargetSite.ToString)
        End Try
    End Sub
#End Region
#Region "ListView Events"
    Private Sub LV_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV.DoubleClick
        Try
            With mFrmDetail
                .lblInfo.Text = Me.mDT_Current.TableName
                .Text = "Detail From " & .lblInfo.Text & "..."
                Dim str As String
                Dim j As Byte
                str = LV.Columns(0).Text & " ..." & LV.SelectedItems(0).Text
                For j = 1 To LV.Columns.Count - 1
                    str = str & C & LV.Columns(j).Text & " ... " & LV.SelectedItems(0).SubItems(j).Text
                Next
                LV.SelectedItems(0).BackColor = Color.Silver
                .txtInfo.Text = str
                .ShowDialog()
            End With
        Catch exp As Exception
            MessageBox.Show(exp.Message & C & exp.Source & C & exp.TargetSite.ToString)
        End Try
    End Sub


#End Region
    Private Function Temporary_LV_ColumnCount(ByVal TNode As TreeNode) As Byte
        Try
            Dim nd As TreeNode
            Dim j As Byte
            For Each nd In TNode.Nodes
                If nd.Checked = True Then
                    j = j + 1
                End If
            Next
            Return j
        Catch exp As Exception
            MessageBox.Show(exp.Message & C & exp.Source & C & exp.TargetSite.ToString)
        End Try
    End Function
#End Region
#Region "ListView Filter"
#Region "LV_Filter Events"
    Private Sub LV_Filter_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV_Filter.DoubleClick
        Try
            With mFrmDetail
                .lblInfo.Text = Me.mDT_Current.TableName
                .Text = "Detail From " & .lblInfo.Text & "..."
                Dim str As String
                Dim j As Byte
                str = LV_Filter.Columns(0).Text & " ..." & LV_Filter.SelectedItems(0).Text
                For j = 1 To LV.Columns.Count - 1
                    str = str & C & LV_Filter.Columns(j).Text & " ... " & LV_Filter.SelectedItems(0).SubItems(j).Text
                Next
                LV_Filter.SelectedItems(0).BackColor = Color.Silver
                .txtInfo.Text = str
                .ShowDialog()
            End With
        Catch exp As Exception
            MessageBox.Show(exp.Message & C & exp.Source & C & exp.TargetSite.ToString)
        End Try
    End Sub

#End Region
#End Region
End Class

Project Homepage: