Option Explicit On
Imports System.Linq
Imports System.Collections.Generic
Imports gmRTL.GUI
Namespace VBSCAN
   Public Class frmRtnLst : Inherits System.Windows.Forms.Form
      Private Dim _disposed As Boolean = False
      <System.Diagnostics.DebuggerNonUserCode()> _
      Public Sub New()
         MyBase.New()
         'This call is required by the Windows Form Designer.
         InitializeComponent()
         'Add any initialization after the InitializeComponent() call
         If m_vb6FormDefInstance Is Nothing Then
            If m_InitializingDefInstance Then
               m_vb6FormDefInstance = Me
            Else
               Try
                  'For the start-up form, the first instance created is the default instance.
                  If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
                     m_vb6FormDefInstance = Me
                  End If
               Catch
               End Try
            End If
         End If
         If (DesignMode) Then Exit Sub
         Form_Resize(Nothing, Nothing)

      End Sub
      'Form overrides dispose to clean up the component list.
      <System.Diagnostics.DebuggerNonUserCode()> _
      Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
         If _disposed Then
            Return
         End If
         If Disposing Then
            If Not components Is Nothing Then
               components.Dispose()
            End If
         End If
         _disposed = True
         MyBase.Dispose(Disposing)
      End Sub
      Private Sub Form_Resize(ByVal sender As Object, ByVal e As EventArgs)
         On Error Resume Next
         List1.Width = Me.ClientRectangle.Width - List1.Left - 10
         List1.Height = Me.ClientRectangle.Height - List1.Top - 10
      End Sub
      Private Sub List1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
         refreshList()
      End Sub
      Private Sub refreshList()
         Dim i As Integer = 0
         Dim m As Integer = 0

         m = List1.Items.Count - 1

         For i = 1 To m Step 1
            List1.SetSelected(i,Convert.ToBoolean(List1.GetItemData(i)))
         Next
         List1.SelectedIndex = 0

      End Sub
   End Class
End Namespace
