Imports System.Windows.Forms
Imports System.Drawing
Imports System.Threading

Public Class frmLandMarkEdit
    Private boolLmSearchMode As Boolean = False
    Public boolValidtyRegionFocused As Boolean = False
    Public boolLocationFocused As Boolean = False
    Dim LmImage As Image



    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Label4.Visible = boolLmSearchMode
        txtBoxFind.Visible = boolLmSearchMode
        picNext.Visible = boolLmSearchMode
        boolValidtyRegionFocused = False
        boolLocationFocused = False
        picLandMark.Visible = False
    End Sub


    Private Sub Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.FormClosing
        Me.Visible = False
        boolViewLM = False
        boolValidtyRegionFocused = False
        boolLocationFocused = False
    End Sub

    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
        tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.X = UpDnLocX.Value
        tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.Y = UpDnLocY.Value
        tlmLandMarkArray(UpDnLM.Value).intLandMarkHeight = UpDnHeight.Text
        tlmLandMarkArray(UpDnLM.Value).LandMarkName = TextBoxName.Text
        tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.X = UpDnValidX.Value
        tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Y = UpDnValidY.Value
        tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Height = UpDnValidHeight.Value
        tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Width = UpDnValidWidth.Value
        tlmLandMarkArray(UpDnLM.Value).LandMarkRecognized = TextBoxRecognized.Text
        tlmLandMarkArray(UpDnLM.Value).LandMarkValid = TextBoxValid.Text
        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Visible = False
        boolViewLM = False
        boolValidtyRegionFocused = False
        boolLocationFocused = False
        Me.Close()
    End Sub

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me.Close()
        boolValidtyRegionFocused = False
        boolLocationFocused = False
        frmGotABotTop.mnuLoadSettings_Click(sender, e)
    End Sub







    Private Sub UpDnLM_KeyUp(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnLM.KeyUp
        boolValidtyRegionFocused = False
        boolLocationFocused = False
    End Sub

    Dim boolRefreshFinished As Boolean = True
    Private Sub UpDnLM_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnLM.ValueChanged
        On Error Resume Next
        boolValidtyRegionFocused = False
        boolLocationFocused = False
        frmGotABotTop.Refresh()
        subWait(25)
        frmGotABotTop.Refresh()
    End Sub


    Delegate Sub DelegateLmRefresh()
    Public Sub subLmRefresh_Tick() Handles timerLmUpdate.Tick
        Try
            If Me.Visible And timerLmUpdate.Enabled And Not InvokeRequired And Not boolLocalizationInProgress Then
                timerLmUpdate.Enabled = False
                UpDnLocX.Value = tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.X
                UpDnLocX.Text = tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.X.ToString
                UpDnLocY.Value = tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.Y
                UpDnLocY.Text = tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.Y.ToString
                UpDnHeight.Value = tlmLandMarkArray(UpDnLM.Value).intLandMarkHeight
                UpDnHeight.Text = tlmLandMarkArray(UpDnLM.Value).intLandMarkHeight.ToString
                TextBoxName.Text = tlmLandMarkArray(UpDnLM.Value).LandMarkName
                UpDnValidX.Value = tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.X
                UpDnValidX.Text = tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.X.ToString
                UpDnValidY.Value = tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Y
                UpDnValidY.Text = tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Y.ToString
                UpDnValidHeight.Value = tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Height
                UpDnValidHeight.Text = tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Height.ToString
                UpDnValidWidth.Value = tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Width
                UpDnValidWidth.Text = tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Width.ToString
                TextBoxRecognized.Text = tlmLandMarkArray(UpDnLM.Value).LandMarkRecognized
                TextBoxValid.Text = tlmLandMarkArray(UpDnLM.Value).LandMarkValid
                picLmLoad()
                UpDnLocX.Maximum = intMapWidth
                UpDnLocY.Maximum = intMapHeight
                UpDnValidX.Maximum = intMapWidth
                UpDnValidY.Maximum = intMapHeight
                UpDnValidWidth.Maximum = intMapWidth
                UpDnValidHeight.Maximum = intMapHeight
            End If
            timerLmUpdate.Enabled = True
        Catch ex As Exception
            timerLmUpdate.Enabled = True
            frmDebug.subWriteLogs(" EXCEPTION in subLmRefresh :  " & ex.ToString)
        End Try
    End Sub



    Private Sub picLmLoad()
        Try
            If boolEnableRcc Then
                If (Dir("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".bmp") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".bmp")
                    picLandMark.Image = LmImage
                ElseIf (Dir("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".gif") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".gif")
                    picLandMark.Image = LmImage
                ElseIf (Dir("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".jpeg") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".jpeg")
                    picLandMark.Image = LmImage
                ElseIf (Dir("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".tiff") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".tiff")
                    picLandMark.Image = LmImage
                ElseIf (Dir("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".png") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files\ER1\objects\" & TextBoxName.Text & ".png")
                    picLandMark.Image = LmImage
                ElseIf (Dir("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".bmp") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".bmp")
                    picLandMark.Image = LmImage
                ElseIf (Dir("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".gif") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".gif")
                    picLandMark.Image = LmImage
                ElseIf (Dir("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".jpeg") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".jpeg")
                    picLandMark.Image = LmImage
                ElseIf (Dir("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".tiff") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".tiff")
                    picLandMark.Image = LmImage
                ElseIf (Dir("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".png") <> "") Then
                    picLandMark.Visible = True
                    LmImage = System.Drawing.Image.FromFile("c:\Program Files (x86)\ER1\objects\" & TextBoxName.Text & ".png")
                    picLandMark.Image = LmImage
                End If
            End If
            frmLM_Image.picLM_Large.Image = LmImage
        Catch ex As Exception
            frmDebug.subWriteLogs(" EXCEPTION in picLmLoad :  " & ex.ToString)
        End Try
    End Sub


    Private Sub frmLandMarkEdit_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        boolValidtyRegionFocused = False
        boolLocationFocused = False
    End Sub

    Private Sub UpDnRecognized_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxRecognized.TextChanged
        If ftnCheckText(TextBoxRecognized.Text) Then
            tlmLandMarkArray(UpDnLM.Value).LandMarkRecognized = Int(TextBoxRecognized.Text)
            boolSettingsChanged = True
            boolValidtyRegionFocused = False
            boolLocationFocused = False
        End If
    End Sub

    Private Sub TextBoxnName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxName.TextChanged
        If ftnCheckText(TextBoxRecognized.Text) Then
            tlmLandMarkArray(UpDnLM.Value).LandMarkName = TextBoxName.Text
            boolSettingsChanged = True
            boolValidtyRegionFocused = False
            boolLocationFocused = False
        End If
    End Sub

  

    '================================= LM Location ================================================================


    Private Sub UpDnLocX_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnLocX.TextChanged
        On Error Resume Next
        If ftnCheckText(UpDnLocX.Text) Then
            UpDnLocX.Value = Val(UpDnLocX.Text)
            subCheckMapArrayLimits(UpDnLocX.Value, UpDnLocY.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.X = UpDnLocX.Value
            boolSettingsChanged = True
            boolValidtyRegionFocused = False
            boolLocationFocused = True
        End If
    End Sub

    Private Sub UpDnLocX_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnLocX.MouseClick
        On Error Resume Next
        If ftnCheckText(UpDnLocX.Text) Then
            UpDnLocX.Value = Val(UpDnLocX.Text)
            subCheckMapArrayLimits(UpDnLocX.Value, UpDnLocY.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.X = UpDnLocX.Value
            boolSettingsChanged = True
            boolValidtyRegionFocused = False
            boolLocationFocused = True
        End If
    End Sub

    Private Sub UpDnLocY_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnLocY.TextChanged
        On Error Resume Next
        If ftnCheckText(UpDnLocY.Text) Then
            UpDnLocY.Value = Val(UpDnLocY.Text)
            subCheckMapArrayLimits(UpDnLocX.Value, UpDnLocY.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.Y = UpDnLocY.Value
            boolValidtyRegionFocused = False
            boolSettingsChanged = True
            boolLocationFocused = True
        End If
    End Sub

    Private Sub UpDnLocY_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnLocY.MouseClick
        On Error Resume Next
        If ftnCheckText(UpDnLocY.Text) Then
            UpDnLocY.Value = Val(UpDnLocY.Text)
            subCheckMapArrayLimits(UpDnLocX.Value, UpDnLocY.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkLocation.Y = UpDnLocY.Value
            boolValidtyRegionFocused = False
            boolSettingsChanged = True
            boolLocationFocused = True
        End If
    End Sub

    Private Sub UpDnHeight_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnHeight.TextChanged
        On Error Resume Next
        If ftnCheckText(UpDnHeight.Value) Then
            UpDnHeight.Value = Val(UpDnHeight.Text)
            tlmLandMarkArray(UpDnLM.Value).intLandMarkHeight = UpDnHeight.Value
            boolValidtyRegionFocused = False
            boolSettingsChanged = True
            boolLocationFocused = True
        End If
    End Sub

    Private Sub UpDnHeight_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnHeight.MouseClick
        On Error Resume Next
        If ftnCheckText(UpDnHeight.Value) Then
            UpDnHeight.Value = Val(UpDnHeight.Text)
            tlmLandMarkArray(UpDnLM.Value).intLandMarkHeight = UpDnHeight.Value
            boolValidtyRegionFocused = False
            boolSettingsChanged = True
            boolLocationFocused = True
        End If
    End Sub


    '================================= Validity Region================================================================
    Private Sub UpDnValidX_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidX.TextChanged
        On Error Resume Next
        If ftnCheckText(UpDnValidX.Text) Then
            UpDnValidX.Value = Val(UpDnValidX.Text)
            subCheckMapArrayLimits(UpDnValidX.Value, UpDnValidY.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.X = UpDnValidX.Value
            boolValidtyRegionFocused = True
            boolSettingsChanged = True
            boolLocationFocused = False
        End If
    End Sub

    Private Sub UpDnValidX_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidX.MouseClick
        On Error Resume Next
        If ftnCheckText(UpDnValidX.Text) Then
            UpDnValidX.Value = Val(UpDnValidX.Text)
            subCheckMapArrayLimits(UpDnValidX.Value, UpDnValidY.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.X = UpDnValidX.Value
            boolValidtyRegionFocused = True
            boolSettingsChanged = True
            boolLocationFocused = False
        End If
    End Sub

    Private Sub UpDnValidY_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidY.TextChanged
        On Error Resume Next
        If ftnCheckText(UpDnValidY.Text) Then
            UpDnValidY.Value = Val(UpDnValidY.Text)
            subCheckMapArrayLimits(UpDnValidX.Value, UpDnValidY.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Y = UpDnValidY.Value
            boolValidtyRegionFocused = True
            boolSettingsChanged = True
            boolLocationFocused = False
        End If
    End Sub

    Private Sub UpDnValidY_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidY.MouseClick
        On Error Resume Next
        If ftnCheckText(UpDnValidY.Text) Then
            UpDnValidY.Value = Val(UpDnValidY.Text)
            subCheckMapArrayLimits(UpDnValidX.Value, UpDnValidY.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Y = UpDnValidY.Value
            boolValidtyRegionFocused = True
            boolSettingsChanged = True
            boolLocationFocused = False
        End If
    End Sub

    Private Sub UpDnValidHeight_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidHeight.TextChanged
        On Error Resume Next
        If ftnCheckText(UpDnValidHeight.Text) Then
            UpDnValidHeight.Value = Val(UpDnValidHeight.Text)
            subCheckMapArrayLimits(UpDnValidWidth.Value, UpDnValidHeight.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Height = UpDnValidHeight.Value
            boolValidtyRegionFocused = True
            boolSettingsChanged = True
            boolLocationFocused = False
        End If
    End Sub

    Private Sub UpDnValidHeigh_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidHeight.MouseClick
        On Error Resume Next
        If ftnCheckText(UpDnValidHeight.Text) Then
            UpDnValidHeight.Value = Val(UpDnValidHeight.Text)
            subCheckMapArrayLimits(UpDnValidWidth.Value, UpDnValidHeight.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Height = UpDnValidHeight.Value
            boolValidtyRegionFocused = True
            boolSettingsChanged = True
            boolLocationFocused = False
        End If
    End Sub

    Private Sub UpDnValidWidth_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidWidth.TextChanged
        On Error Resume Next
        If ftnCheckText(UpDnValidWidth.Text) Then
            UpDnValidWidth.Value = Val(UpDnValidWidth.Text)
            subCheckMapArrayLimits(UpDnValidWidth.Value, UpDnValidHeight.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Width = UpDnValidWidth.Value
            boolValidtyRegionFocused = True
            boolSettingsChanged = True
            boolLocationFocused = False
        End If
    End Sub

    Private Sub UpDnValidWidth_MouseClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidWidth.MouseClick
        On Error Resume Next
        If ftnCheckText(UpDnValidWidth.Text) Then
            UpDnValidWidth.Value = Val(UpDnValidWidth.Text)
            subCheckMapArrayLimits(UpDnValidWidth.Value, UpDnValidHeight.Value)
            tlmLandMarkArray(UpDnLM.Value).LandMarkValidRegion.Width = UpDnValidWidth.Value
            boolValidtyRegionFocused = True
            boolSettingsChanged = True
            boolLocationFocused = False
        End If
    End Sub


    '=================================================================================================

    Private Sub UpDnValidWidth_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidWidth.ValueChanged
        boolSettingsChanged = True
    End Sub


    Private Sub UpDnValid_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxValid.TextChanged
        On Error Resume Next
        If ftnCheckText(TextBoxValid.Text) Then tlmLandMarkArray(UpDnLM.Value).LandMarkValid = Int(TextBoxValid.Text)
    End Sub


    Private Sub me_MouseWheel(ByVal sender As System.Object, ByVal e As MouseEventArgs) Handles Me.MouseWheel
        On Error Resume Next
        If (e.Delta <> 0) And UpDnLM.Focused Then
            If e.Delta <= 0 Then
                If (Me.UpDnLM.Value > 0) Then UpDnLM.Value = UpDnLM.Value - 1
            Else
                If (Me.UpDnLM.Value < 127) Then UpDnLM.Value = UpDnLM.Value + 1
            End If
        End If
    End Sub




    Private Sub butClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butClearStat.Click
        On Error Resume Next
        Dim I As Integer
        For I = 0 To 127
            tlmLandMarkArray(I).LandMarkRecognized = 0
            tlmLandMarkArray(I).LandMarkValid = 0
        Next
        TextBoxRecognized.Text = "0"
        TextBoxValid.Text = "0"
        boolValidtyRegionFocused = False
        boolLocationFocused = False
        Me.Refresh()
    End Sub

    Private Function ftnCheckText(ByVal strTextToCheck As String) As Boolean
        On Error Resume Next
        If ((Val(strTextToCheck) >= 0) And strTextToCheck <> "-" And strTextToCheck <> "") Then
            ftnCheckText = True
        Else
            ftnCheckText = False
        End If
    End Function

    Private Function ftnRangeCheck(ByVal sngValueToCheck As Single, ByVal sngMaxValue As Single) As Boolean
        On Error Resume Next
        If ((sngValueToCheck >= 0) And (sngValueToCheck <= sngMaxValue)) Then
            ftnRangeCheck = True
        Else
            ftnRangeCheck = False
        End If
    End Function





    Private Sub butDeleteLM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butDeleteLM.Click
        For intLMNumber As Integer = UpDnLM.Value To 126
            tlmLandMarkArray(intLMNumber) = tlmLandMarkArray(intLMNumber + 1)
        Next
        tlmLandMarkArray(126).LandMarkName = ""
        tlmLandMarkArray(126).LandMarkLocation.X = 0
        tlmLandMarkArray(126).LandMarkLocation.Y = 0
        tlmLandMarkArray(126).intLandMarkHeight = 0
        tlmLandMarkArray(126).LandMarkValidRegion.Height = 0
        tlmLandMarkArray(126).LandMarkValidRegion.Width = 0
        tlmLandMarkArray(126).LandMarkValidRegion.X = 0
        tlmLandMarkArray(126).LandMarkValidRegion.Y = 0
        tlmLandMarkArray(126).LandMarkRecognized = 0
        tlmLandMarkArray(126).LandMarkValid = 0
        boolValidtyRegionFocused = False
    End Sub

    '////////////////////////////  Search Functions  //////////////////////////

    Private Sub PicSearchButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PicSearchButton.Click
        boolLmSearchMode = Not boolLmSearchMode
        Label4.Visible = boolLmSearchMode
        txtBoxFind.Visible = boolLmSearchMode
        picNext.Visible = boolLmSearchMode
        If boolLmSearchMode Then
        Else
            txtBoxFind.Text = ""
        End If
        boolValidtyRegionFocused = False
        boolLocationFocused = False
    End Sub


    Private Sub txtBoxFind_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBoxFind.TextChanged
        Dim intLandMarkNo As Integer = -1
        Do
            intLandMarkNo = intLandMarkNo + 1
        Loop Until ((intLandMarkNo = UBound(tlmLandMarkArray)) Or CBool(InStr(tlmLandMarkArray(intLandMarkNo).LandMarkName, txtBoxFind.Text)))

        If (CBool(InStr(tlmLandMarkArray(intLandMarkNo).LandMarkName, txtBoxFind.Text))) Then
            UpDnLM.Value = intLandMarkNo
        End If
    End Sub

    Private Sub picNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picNext.Click
        Dim intStartingLandMarkNo As Integer = UpDnLM.Value
        Dim intLandMarkNo As Integer = UpDnLM.Value
        Do
            intLandMarkNo = intLandMarkNo + 1
            If (intLandMarkNo > UBound(tlmLandMarkArray)) Then intLandMarkNo = 0
        Loop Until ((intLandMarkNo = intStartingLandMarkNo) Or CBool(InStr(tlmLandMarkArray(intLandMarkNo).LandMarkName, txtBoxFind.Text)))

        If (CBool(InStr(tlmLandMarkArray(intLandMarkNo).LandMarkName, txtBoxFind.Text))) Then
            UpDnLM.Value = intLandMarkNo
            boolValidtyRegionFocused = False
        End If
    End Sub

    Private Sub UpDnValidHeight_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidHeight.ValueChanged
        boolSettingsChanged = True
    End Sub

    Private Sub UpDnValidX_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidX.ValueChanged
        boolSettingsChanged = True
    End Sub

    Private Sub UpDnValidY_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnValidY.ValueChanged
        boolSettingsChanged = True
    End Sub

    Private Sub UpDnLocX_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnLocX.ValueChanged
        boolSettingsChanged = True
    End Sub

    Private Sub UpDnLocY_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpDnLocY.ValueChanged
        boolSettingsChanged = True
    End Sub

    Private Sub UpDnHeight_ValueChanged(sender As System.Object, e As System.EventArgs) Handles UpDnHeight.ValueChanged
        boolSettingsChanged = True
    End Sub

    Private Sub picLandMark_Click(sender As System.Object, e As System.EventArgs) Handles picLandMark.Click
        frmLM_Image.picLM_Large.Image = LmImage
        frmLM_Image.Visible = Not frmLM_Image.Visible
        boolValidtyRegionFocused = False
    End Sub

    Private Sub Label7_Click(sender As Object, e As EventArgs) Handles Label7.Click

    End Sub
End Class



