Imports System.Windows.Forms

Public Class dlgImage

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub


    Private Sub dlgImage_MouseClick(sender As Object, e As MouseEventArgs) Handles MyBase.MouseClick
        Me.Close()
    End Sub

    Private Sub dlgImage_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles MyBase.MouseDoubleClick
        Me.Close()
    End Sub

    Private Sub dlgImage_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
        If e.KeyCode = Keys.Enter OrElse e.KeyCode = Keys.Escape Then
            Me.Close()
        End If
    End Sub

    Private Sub dlgImage_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.Width = My.Settings.DLG_IMAGE_WIDTH
        Me.Height = My.Settings.DLG_IMAGE_HEIGHT
        Me.Left = My.Settings.DLG_IMAGE_LEFT
        Me.Top = My.Settings.DLG_IMAGE_TOP
    End Sub
    Private Sub dlgImage_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        My.Settings.DLG_IMAGE_WIDTH = Me.Width
        My.Settings.DLG_IMAGE_HEIGHT = Me.Height
        My.Settings.DLG_IMAGE_LEFT = Me.Left
        My.Settings.DLG_IMAGE_TOP = Me.Top
        My.Settings.Save()
    End Sub
End Class
