using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Data;
using VBNET = Microsoft.VisualBasic;
using gmRTL.Core;
using gmRTL.GUI;
using Microsoft.VisualBasic.CompilerServices;
using System.Linq;
using System.Collections.Generic;

namespace VBSCAN
{
   public partial class frmRtnLst : System.Windows.Forms.Form
   {
      private bool _disposed = false;
      public frmRtnLst()
      {
         if(m_vb6FormDefInstance == null)
         {
            m_vb6FormDefInstance = this;
         }
         //
         // Required for Windows Form Designer support
         //
         InitializeComponent();

         //
         // TODO: Add any constructor code after InitializeComponent call
         //
         if (DesignMode) return;
         Form_Resize(null, null);
      }

      /// <summary>
      /// Clean up any resources being used.
      /// </summary>
      /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
      protected override void Dispose(bool disposing)
      {
         if (_disposed)
         {
            return;
         }
         if (disposing)
         {
            if (components != null)
            {
               components.Dispose();
            }
         }
         _disposed = true;
         base.Dispose(disposing);
      }

      private void Form_Resize(object sender, EventArgs e)
      {
         gmRTL.Core.ErrorHandling.ResumeNext(() =>
         {
            List1.Width = this.ClientRectangle.Width - List1.Left - 10;
            List1.Height = this.ClientRectangle.Height - List1.Top - 10;
         });
      }
      private void List1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
      {
         refreshList();
      }
      private void refreshList()
      {
         int i = 0;
         int m = 0;

         m = List1.Items.Count - 1;

         for(i = 1; i <= m; i += 1)
         {
            List1.SetSelected(i,(List1.GetItemData(i)).ToBool());
         }
         List1.SelectedIndex = 0;

      }
   }
}
