Option Strict Off
Option Explicit On
Friend Class Form1
	Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
	Public Sub New()
		MyBase.New()
		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
		'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 WithEvents Command1 As System.Windows.Forms.Button
	Public WithEvents Text2 As System.Windows.Forms.TextBox
	Public WithEvents ImageKitThumb1 As AxIMAGEKIT7THUMBLib.AxImageKitThumb
	Public WithEvents ImageKit1 As AxIMAGEKIT7Lib.AxImageKit
	'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.
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
        Me.Command1 = New System.Windows.Forms.Button
        Me.Text2 = New System.Windows.Forms.TextBox
        Me.ImageKitThumb1 = New AxIMAGEKIT7THUMBLib.AxImageKitThumb
        Me.ImageKit1 = New AxIMAGEKIT7Lib.AxImageKit
        CType(Me.ImageKitThumb1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.ImageKit1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Command1
        '
        Me.Command1.BackColor = System.Drawing.SystemColors.Control
        Me.Command1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Command1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Command1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Command1.Location = New System.Drawing.Point(400, 96)
        Me.Command1.Name = "Command1"
        Me.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Command1.Size = New System.Drawing.Size(145, 33)
        Me.Command1.TabIndex = 3
        Me.Command1.Text = "Load Thumbnail Images"
        '
        'Text2
        '
        Me.Text2.AcceptsReturn = True
        Me.Text2.AutoSize = False
        Me.Text2.BackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.Text2.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.Text2.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Text2.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
        Me.Text2.Location = New System.Drawing.Point(8, 8)
        Me.Text2.MaxLength = 0
        Me.Text2.Multiline = True
        Me.Text2.Name = "Text2"
        Me.Text2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Text2.Size = New System.Drawing.Size(593, 80)
        Me.Text2.TabIndex = 2
        Me.Text2.Text = "This sample shows how to click a thumbnail image and display it in the ImageKit C" & _
        "ontrol. Selecting a thumbnail generates the SelectFile event where the image fil" & _
        "ename and path can be retrieved and used to load the image into the ImageKit Con" & _
        "trol. The Thumbnail Control can do a variety of things easily like display image" & _
        "s from multiple directories, load only images of a certain type or certain filen" & _
        "ames, display text under thumbnails, etc. In this sample, only JPEG images are l" & _
        "oaded."
        '
        'ImageKitThumb1
        '
        Me.ImageKitThumb1.Location = New System.Drawing.Point(336, 144)
        Me.ImageKitThumb1.Name = "ImageKitThumb1"
        Me.ImageKitThumb1.OcxState = CType(resources.GetObject("ImageKitThumb1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.ImageKitThumb1.Size = New System.Drawing.Size(273, 313)
        Me.ImageKitThumb1.TabIndex = 1
        '
        'ImageKit1
        '
        Me.ImageKit1.Location = New System.Drawing.Point(8, 96)
        Me.ImageKit1.Name = "ImageKit1"
        Me.ImageKit1.OcxState = CType(resources.GetObject("ImageKit1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.ImageKit1.Size = New System.Drawing.Size(321, 360)
        Me.ImageKit1.TabIndex = 0
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.SystemColors.Control
        Me.ClientSize = New System.Drawing.Size(616, 462)
        Me.Controls.Add(Me.Command1)
        Me.Controls.Add(Me.Text2)
        Me.Controls.Add(Me.ImageKitThumb1)
        Me.Controls.Add(Me.ImageKit1)
        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(4, 30)
        Me.Name = "Form1"
        Me.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Text = "Select a Thumbnail and Display the Image"
        CType(Me.ImageKitThumb1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.ImageKit1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub
#End Region 
#Region "Upgrade Support "
	Private Shared m_vb6FormDefInstance As Form1
	Private Shared m_InitializingDefInstance As Boolean
	Public Shared Property DefInstance() As Form1
		Get
			If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
				m_InitializingDefInstance = True
				m_vb6FormDefInstance = New Form1()
				m_InitializingDefInstance = False
			End If
			DefInstance = m_vb6FormDefInstance
		End Get
		Set
			m_vb6FormDefInstance = Value
		End Set
	End Property
#End Region 
	
	Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
		'set the types of images that can be loaded into the thumbnail control...
		ImageKitThumb1.FileExt = "JPG"
		
		'set the path to the images...
        ImageKitThumb1.FilePath = Application.StartupPath & "\..\..\..\..\..\..\Images\ForSamples\Thumbnails\"
		
		'display the images in the thumbnail control...
		ImageKitThumb1.GetFiles()
		ImageKitThumb1.Display()
		
		'display the filenames under the thumbnail images...
		ImageKitThumb1.DispFileName = True
	End Sub
	
    Private Sub ImageKitThumb1_SelectFile1(ByVal sender As Object, ByVal e As AxIMAGEKIT7THUMBLib._IImageKitThumbEvents_SelectFileEvent) Handles ImageKitThumb1.SelectFile
        'set the filename and path of the image whose thumbnail has been selected...
        ImageKit1.File.FileName = e.pathName & e.fileName

        'load the image file...
        ImageKit1.File.LoadFile(IMAGEKIT7Lib.LoadFileConstants.ikLoad)

        'display the image in actual sized display mode...
        ImageKit1.ScrollBar = True
        ImageKit1.Display(IMAGEKIT7Lib.DispModeConstants.ikActualSize)
    End Sub
End Class