Public Class AddEpoleCable

    ' Dim SaveFlag As Boolean = False
    Dim DT As ireaDataSet.Detail_CableDataTable
    Dim Sorted As ESorted = ESorted.No
    Dim viewTag As String = "jcable"
    Public PrnForm As printformCable
    Dim IsNew As Boolean = False
    Private Sub NewRowAddToDataTable(ByVal sender As Object, ByVal e As System.Data.DataTableNewRowEventArgs) 'Handles DT.TableNewRow '//New Row Add & Setting Default Data
        Dim NEwrow As DataRow = e.Row
        NEwrow("rowid") = System.Guid.NewGuid
        NEwrow("관리ID") = CInt(Me.h_id.Text)
        NEwrow("번호") = CInt(Me.Get_NewNumber)
        NEwrow("출력") = True
        NEwrow("비고1") = ""
        NEwrow("비고2") = ""
        NEwrow("비고3") = ""
        NEwrow("비고4") = ""
        NEwrow("비고5") = ""

        Dim newid As Integer = CInt(Me.Get_NewNumber)
        If Me.Sorted = ESorted.CANT Then
            NEwrow("정렬번호") = "히" & "1" & Format(newid, "00000") & "1000"
        Else
            NEwrow("정렬번호") = "1" & Format(newid, "00000") & "1000"
        End If
    End Sub

    Public Sub New(ByVal maxid As Integer)

        ' 이 호출은 Windows Form 디자이너에 필요합니다.
        InitializeComponent()

        Dim INI As New MyINI2(My.Application.Info.DirectoryPath & "\epole.ini")
        Me.h_date.Enabled = True
        Me.h_name.Enabled = True
        Me.h_bigo.Enabled = True
        Me.h_id.Enabled = False
        Me.h_dan.Enabled = True
        Me.Text = "지중(맨홀표시찰및계통도) 입력(신규작업)"
        Me.h_name.Text = INI.Read("main", "lastkname1") 'InputBox("거래처명을 입력하세요", "신규입력-거래처명", "해광기획")
        Me.h_dan.Text = "0" 'InputBox("수량별 단가를 입력하세요", "신규입력-단가", "0")
        Me.h_id.Text = maxid
        Me.h_bigo.Text = "지중(맨홀표시찰및계통도)제작(" & Format(Now, "MM") & "-" & Format(Now, "dd") & ")"
        Me.h_date.Text = Format(Now, "yyyy/MM/dd")
        Me.IsNew = True
    End Sub

    Public Sub New(ByVal v_id As String, ByVal V_DATE As String, ByVal V_NAME As String, ByVal V_BIGO As String, ByVal V_DAN As String)

        ' 이 호출은 Windows Form 디자이너에 필요합니다.
        InitializeComponent()

        Me.h_date.Text = V_DATE
        Me.h_name.Text = V_NAME
        Me.h_bigo.Text = V_BIGO
        Me.h_dan.Text = V_DAN
        Me.h_id.Text = v_id
        Me.h_date.Enabled = False
        Me.h_name.Enabled = False
        Me.h_bigo.Enabled = False
        Me.h_id.Enabled = False
        Me.h_id.Enabled = False
        Me.Text = "지중(맨홀표시찰및계통도) 입력"

    End Sub

    Private Sub AddEpole_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Me.bs.EndEdit()

        If bs.Count > 0 Then
            Dim Drv As DataRowView
            Drv = bs.Item(bs.Count - 1)
            If NVL(Drv("관리구"), "") = "" AndAlso _
             NVL(Drv("전산번호"), "") = "" Then
                Drv.Delete()
            End If
        End If
        Me.CHk_Modify()
        Frm_Main.bt_find.PerformClick()
    End Sub

    Private Sub AddEpole_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.view1.ASetting_Load(False, Me.viewTag)
        Me.view1.한글필드 = New String() {"HASS", "HADL", "HBSS", "HBDL", "시공년월", "시공회사", "감독자", "비고1", "비고2", "비고3", "비고4", "비고5", "비고6", _
         "S0수용가", "S1위치", "S2위치", "S3위치", "S4위치", _
"S0SS", "S1SS", "S2SS", "S3SS", "S4SS", "S0DL", "S1DL", "S2DL", "S3DL", "S4DL"}

        Me.view1.Font = New Font(ViewFont.FontName, ViewFont.FontSize, Me.Font.Style)   '//글자정보 불러오기
        Me.bn.Font = New Font(MenuFont.FontName, MenuFont.FontSize, Me.Font.Style)   '//글자정보 불러오기
        Me.ToolStrip1.Font = New Font(MenuFont.FontName, MenuFont.FontSize, Me.Font.Style)   '//글자정보 불러오기
        Me.StatusStrip1.Font = New Font(MenuFont.FontName, MenuFont.FontSize, Me.Font.Style)   '//글자정보 불러오기

        AddHandler IreaDataSet1.Detail_Cable.TableNewRow, AddressOf NewRowAddToDataTable
        DT = Me.IreaDataSet1.Detail_Cable
        Me.SETTOOLTIP()
        ''''''''데이터보여주기
        If Me.IsNew Then  '//현재id와같은 데이터는 모두삭제를 하게한다.
            Dim Cmd As New OleDbCommand("delete from  detail_cable  where 관리id=" & Me.h_id.Text, Me.ta.Connection)
            If Cmd.Connection.State <> ConnectionState.Open Then Cmd.Connection.Open()
            Cmd.ExecuteNonQuery()
            Me.IsNew = False
        End If
        Display_Data()


    End Sub
    Private Sub SETTOOLTIP()
        Dim TMSG As New System.Text.StringBuilder()
        TMSG.AppendLine()
        TMSG.AppendLine("오른쪽 클릭시 기타메뉴가 표시됩니다")
        TMSG.AppendLine()
        TMSG.AppendLine("<단축키 : ENTER:다음칸 , SHIFT+TAB:이전칸>")
        TMSG.AppendLine("<단축키 : DELETE:현재칸 지우기 , SHIFT+DELETE 현재줄 삭제>")
        TMSG.AppendLine("<단축키 : F2:현재칸지우고 편집>")
        TMSG.AppendLine("<단축키 : SPACE-BAR/F3:현재칸 편집>")
        TMSG.AppendLine("<단축키 : CTRL + 마우스휠 : 화면크기를 조절합니다>")
        TMSG.AppendLine()
        Me.ToolTip1.SetToolTip(Me.view1, TMSG.ToString)

    End Sub
    Private Sub SetFarPoint()
        ' Me.view1.AEnterToNextItem()
        Me.view1.DataSource = Me.bs
    End Sub

    ''' <summary>
    ''' 신규추가시 번호를 생성해줍니다(현존최대넘버+1)
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Function Get_NewNumber() As Integer
        Dim maxCnt As Integer = 0
        For i As Integer = 0 To Me.view1_Sheet1.RowCount - 1
            If Me.view1_Sheet1.Cells(i, 1).Value > maxCnt Then maxCnt = Me.view1_Sheet1.Cells(i, 1).Value
        Next
        Return maxCnt + 1
    End Function

    Private Sub CHk_Modify(Optional ByVal prompt As Boolean = True)
        Me.bs.EndEdit()
        If Not Me.IreaDataSet1.HasChanges Then
            NOTICE("변경된 내용이 없습니다", Me.lb_msg)
            Return
        End If

        If prompt Then
            If MsgBox("변경된 데이터를 저장하시겠습니까?", MsgBoxStyle.Information + MsgBoxStyle.OkCancel, "저장확인") <> MsgBoxResult.Ok Then Return
        End If


        Try
            Me.ta.Update(Me.IreaDataSet1.Detail_Cable)   '//Commit insert/update/delete
            Me.IreaDataSet1.jjungtable.AcceptChanges()    '//Set All Green

            Try
                Dim SQl As String = "insert into 전주관리(id,날짜,거래처명,비고,총수량,단가,금액,번호찰구분) values(:1,:2,:3,:4,:5,:6,:7,6)"
                If Me.ta.Connection.State <> ConnectionState.Open Then Me.ta.Connection.Open()
                Dim Cmd As New OleDbCommand(SQl, Me.ta.Connection)
                Cmd.Parameters.Add(":1", OleDbType.Integer).Value = Val(Me.h_id.Text)
                Cmd.Parameters.Add(":2", OleDbType.Date).Value = IIf(Me.h_date.Text.Trim = "", DBNull.Value, Me.h_date.Text.Trim)
                Cmd.Parameters.Add(":3", OleDbType.VarChar).Value = Me.h_name.Text
                Cmd.Parameters.Add(":4", OleDbType.VarChar).Value = Me.h_bigo.Text
                Cmd.Parameters.Add(":5", OleDbType.Integer).Value = Me.IreaDataSet1.Detail_Cable.Rows.Count 'Me.view1_Sheet1.RowCount
                Cmd.Parameters.Add(":6", OleDbType.Integer).Value = Val(Me.h_dan.Text)
                Cmd.Parameters.Add(":7", OleDbType.Currency).Value = Val(Me.h_dan.Text) * Me.view1_Sheet1.RowCount
                Cmd.ExecuteNonQuery()
            Catch ex As Exception
                Dim SQl As String = "update 전주관리 set 날짜=:2,거래처명=:3,비고=:4,총수량=:5,단가=:6,금액=:7,번호찰구분=6 where id=:1"
                If Me.ta.Connection.State <> ConnectionState.Open Then Me.ta.Connection.Open()
                Dim Cmd As New OleDbCommand(SQl, Me.ta.Connection)
                Cmd.Parameters.Add(":2", OleDbType.Date).Value = IIf(Me.h_date.Text.Trim = "", DBNull.Value, Me.h_date.Text.Trim)
                Cmd.Parameters.Add(":3", OleDbType.VarChar).Value = Me.h_name.Text
                Cmd.Parameters.Add(":4", OleDbType.VarChar).Value = Me.h_bigo.Text
                Cmd.Parameters.Add(":5", OleDbType.Integer).Value = Me.IreaDataSet1.Detail_Cable.Rows.Count
                Cmd.Parameters.Add(":6", OleDbType.Integer).Value = Val(Me.h_dan.Text)
                Cmd.Parameters.Add(":7", OleDbType.Currency).Value = Val(Me.h_dan.Text) * Me.view1_Sheet1.RowCount
                Cmd.Parameters.Add(":1", OleDbType.Integer).Value = Val(Me.h_id.Text)
                Cmd.ExecuteNonQuery()
            Finally
                'MakeList.bt_find.PerformClick()
                'Display_Data(True)
                Dim INI As New MyINI2(My.Application.Info.DirectoryPath & "\epole.ini")
                INI.Write("main", "lastkname1", Me.h_name.Text)
                NOTICE("저장되었습니다", Me.lb_msg)
                My.Computer.Audio.Play(My.Application.Info.DirectoryPath & "\sound\notify.wav", AudioPlayMode.Background)
                'MakeList.Display_Data() '//이건 bt_find 에서 재호출된다.
            End Try

        Catch ex As Exception
            MsgBox("데이터베이스 업데이트중 오류가 발생했습니다" & vbCrLf & vbCrLf & ex.ToString, MsgBoxStyle.Critical, "ERROR-")
            Me.IreaDataSet1.Detail_Cable.RejectChanges()
            NOTICE("저장 실패!", Me.lb_msg)
        Finally
            view1.ActiveSheet.GetDataView(True) '//화면을 갱신한다.
        End Try
    End Sub


    Private Sub Display_Data(Optional ByVal AutoSort As Boolean = False)   '//뷰에데이터를 표시한다.
        Me.bs.Sort = "정렬번호,번호"   '//정렬된것들은 정렬된채로 보여준다.
        Me.ta.Fill(Me.IreaDataSet1.Detail_Cable, Me.h_id.Text)   '//관리id를 통해서 데이터를 채운다.
        SetFarPoint()  '//여기서 파포인트를 바인딩 소스와 연결시킨다(바인딩 소스는 테이블에 연결되어있다)
        If Me.IreaDataSet1.Detail_Cable.Rows.Count <= 0 Then
            Me.bt_addrow.PerformClick()
            NOTICE("데이터가 존재하지 않습니다", Color.Red, Me.lb_msg)
            Return
        End If
        NOTICE(Me.view1.ActiveSheet.RowCount & "개의 데이터가 검색되었습니다", Me.lb_msg)
    End Sub


    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        Me.bt_commit.PerformClick() '//저장할게잇으면 다 저장한다.
        Me.view1.SuspendLayout()
        Dim A As New XLSImport(Me.IreaDataSet1, Me.h_id.Text, 6)
        A.ShowDialog()
        Me.CHk_Modify(False)
        Me.Display_Data()
        Me.view1.ResumeLayout()
    End Sub

    Private Sub ToolStripButton2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
        Me.bs.EndEdit()
        If Me.view1.Cells("출력").Value = False Then
            MsgBox("현재 선택된 줄은 출력이 되지않도록 설정되어있습니다", MsgBoxStyle.Critical, "확인")
            Return
        End If

        PrnForm = New printformCable(Me.IreaDataSet1.Detail_Cable, CType(Me.bs.Current, DataRowView)) 'Me.view1.ActiveSheet.ActiveRowIndex)
        PrnForm.ShowDialog()

    End Sub

    Private Sub ToolStripMenuItemolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem.Click
        '''''검색방법은 1번개체부터 마지막개체까지 풀루프를 돌면서 동일한 놈을 찾는다.
        Dim 원본, 대상 As String 'New System.Text.StringBuilder
        Dim fcnt As Integer = 0

        Me.pbar.Value = 0
        Me.pbar.Minimum = 0
        Me.pbar.Maximum = Me.view1.ActiveSheet.RowCount

        NOTICE("중복되는 [관리구/전산번호]를 찾는중입니다...", Me.lb_msg)
        Me.Invalidate()
        For Each A As FarPoint.Win.Spread.Row In Me.view1.ActiveSheet.Rows
            원본 = Me.view1.ActiveSheet.Cells(A.Index, 3).Value & Me.view1.ActiveSheet.Cells(A.Index, 4).Value
            If 원본.ToString <> "" Then
                For Each B As FarPoint.Win.Spread.Row In Me.view1.ActiveSheet.Rows
                    If A.Index <> B.Index Then   '//같은라인은 피하고 그렇지 않은 라인의 번호를 확인한다.
                        대상 = Me.view1.ActiveSheet.Cells(B.Index, Me.view1.ColIndex("관리구")).Value & Me.view1.ActiveSheet.Cells(B.Index, Me.view1.ColIndex("전산번호")).Value
                        If 원본.ToString = 대상.ToString Then
                            fcnt += 1
                            Me.view1.ActiveSheet.Cells(A.Index, Me.view1.ACheckBox_ColIndex).Value = True
                            Me.view1.ActiveSheet.Cells(B.Index, Me.view1.ACheckBox_ColIndex).Value = True
                        End If
                    End If
                Next
            End If
            If Me.pbar.Value < Me.pbar.Maximum Then Me.pbar.Value += 1
            Me.Invalidate()
        Next
        NOTICE("[관리구/전산번호] 중복검사 완료(" & fcnt & "개의 데이터를 찾았습니다)", Me.lb_msg)
    End Sub
    Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_addrow.Click
        If Me.Sorted = ESorted.NULL Then Check_Sorted()
        Me.view1.AAddNewRow()
    End Sub

    Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_commit.Click
        '//언바운드된 열을 여기서 바운드시켜분다.
        'Me.view1.Attach_Ubound(3)
        Me.bs.EndEdit()

        If bs.Count > 0 Then
            Dim Drv As DataRowView
            Drv = bs.Item(bs.Count - 1)
            If NVL(Drv("관리구"), "") = "" AndAlso _
             NVL(Drv("전산번호"), "") = "" Then
                Drv.Delete()
            End If
        End If

        If Not Me.IreaDataSet1.HasChanges Then
            NOTICE("변경된 데이터가 없습니다", Me.lb_msg)
            Return
        End If
        Me.bt_find.PerformClick()
    End Sub

    Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_cancel.Click
        Me.bs.EndEdit()
        If Me.IreaDataSet1.HasChanges Then
            Me.IreaDataSet1.RejectChanges()
            NOTICE("변경된 내용이 취소되었습니다.", Me.lb_msg)
        Else
            NOTICE("변경내역이 없습니다", Me.lb_msg)
        End If
    End Sub

    Private Sub olStripMenuItem1tripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles olStripMenuItem1.Click
        Me.view1.ASelect(Me.view1.ACheckBox_ColIndex)
    End Sub

    Private Sub lStripMenuItem2ipMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lStripMenuItem2.Click
        Me.view1.AUnselect(Me.view1.ACheckBox_ColIndex)
    End Sub

    Private Sub gfsdlStripMenuItem2MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles gfsdlStripMenuItem2.Click
        Me.view1.AReverse(Me.view1.ACheckBox_ColIndex)
    End Sub

    Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click
        If Me.view1.ActiveSheet.Rows.Count > 0 Then
            Me.view1.ActiveSheet.ActiveRow.Remove()
            NOTICE("현재줄이 삭제되었습니다", Me.lb_msg)
        Else
            MsgBox("더이상 삭제할 줄이 없습니다")
        End If
    End Sub

    Private Sub view1_Arin_AddLog(ByVal sender As Object, ByVal msg As String) Handles view1.Arin_AddLog
        If Admin Then Log.Show()
        If Admin Then Log.RichTextBox1.AppendText(msg & vbCrLf)
    End Sub

    Private Sub view1_Arin_Before_EditModeOff(ByVal sender As Object, ByVal e As System.EventArgs) Handles view1.Arin_Before_EditModeOff
        'With Me.view1.ActiveSheet
        '    Select Case .ActiveColumn.Label
        '        Case "형식및용량"
        '            If (.Cells(.ActiveRowIndex, .ActiveColumnIndex - 1).Text = "" OrElse _
        '               .Cells(.ActiveRowIndex, .ActiveColumnIndex - 1).Text = vbNullString) AndAlso _
        '               .ActiveCell.Text.Length = 4 Then
        '                .ActiveCell.Text = .ActiveCell.Text.Substring(0, 2) & "-" & .ActiveCell.Text.Substring(2, 1) & "-" & .ActiveCell.Text.Substring(3)
        '                'Else
        '                '    Me.Text = .ActiveCell.Text.Length & "/" & .Cells(.ActiveRowIndex, .ActiveColumnIndex - 1).Text
        '            End If
        '        Case "기기명"
        '            Select Case .ActiveCell.Text.ToUpper
        '                Case "SW"
        '                    .ActiveCell.Text = "PAD SW"
        '                Case "SK"
        '                    .ActiveCell.Text = "지상개폐기"
        '                Case "TR"
        '                    .ActiveCell.Text = "PAD TR"
        '                Case "TK"
        '                    .ActiveCell.Text = "지상변압기"
        '            End Select
        '    End Select
        'End With
    End Sub

    Private Sub view1_DragFillBlockCompleted(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.DragFillBlockCompletedEventArgs) Handles view1.DragFillBlockCompleted
        For i As Integer = e.RowBegin To e.RowBegin + e.NumberToCopy
            ' Dim ds As DataSet = FpSpread1.Sheets(0).DataSource
            Me.IreaDataSet1.Detail_Cable.Rows(view1.Sheets(0).GetModelRowFromViewRow(i)).EndEdit()
        Next

    End Sub

    Private Sub Check_Sorted()
        If Me.Sorted = ESorted.NULL Then  '//아직 검색이된건지 확인안해봣다
            Me.Sorted = ESorted.No
            For i As Short = 0 To IIf(Me.DT.Rows.Count > 10, 10, Me.DT.Rows.Count - 1)
                If NVL(DT.Rows(i)("정렬번호")) <> "" AndAlso NVL(DT.Rows(i)("정렬번호")) <> "히히히000000000" AndAlso NVL(DT.Rows(i)("정렬번호")) <> "히" Then '//데이터가있다면
                    Me.Sorted = ESorted.YES
                    Exit For
                End If
            Next
        End If
    End Sub
    Private Sub Make_Index()
        Work_Form("인덱스를 생성하고 있습니다")
        Form_Work.ProgressBar1.Minimum = 0
        Form_Work.ProgressBar1.Maximum = Me.DT.Rows.Count
        Dim Num As Short
        For i As Integer = 0 To Me.DT.Rows.Count - 1
            Form_Work.pval = i
            Num = Me.DT.Rows(i)("번호")
            Me.DT.Rows(i)("정렬번호") = "1" & Format(Num, "00000") & "1000"
        Next
        Form_Work.Close()  '//작업창 닫기
        Me.Sorted = ESorted.YES
    End Sub
    Private Sub bt_insertrow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_insertrow.Click
        ' Me.view1.AInsertNewRow()    '//번호문제도있다.
        '//현재줄 바로위에 한줄을삽입한다.
        '//새로운ID는 전줄의ID+1 이며
        Me.bs.EndEdit()

        '//위에서부터 5개또는 마지막까지 이게 정렬된데이터인지 확인합니다.
        If Me.Sorted = ESorted.NULL Then Check_Sorted()
        If Me.Sorted = ESorted.No Then Make_Index() '//인덱스를 생성한다.

        Dim NR As ireaDataSet.Detail_CableRow = Me.DT.NewDetail_CableRow   '//삽입은 현재줄 위에 삽입하는것이다. 현재줄의 인덱스번호가 숫자형태라면 정렬이안된데이터다
        Dim 정렬번호 As String = bs.Current("정렬번호")
        Dim N정렬번호 As String
        If Not Me.Sorted = ESorted.CANT AndAlso IsNumeric(정렬번호) AndAlso 정렬번호.Length >= 8 Then  '//숫자라면 인덱스정렬법이다.
            Dim MN As String = 정렬번호.Substring(0, 6)
            Dim SN As Short = 정렬번호.Substring(6)
            'NR.번호 = bs.Current("번호") - 1 '//번호는 -1하고
            'If NR.번호 < 1 Then NR.번호 = 0
            N정렬번호 = MN & Format(SN - 1, "0000") '//현재 일련번호에 -을 해서 넣느다.  이부분 변경하자..변경한이름이 있을경우 해당위로의 숫자를 -1해야한다.

            '//새로우 정렬번호랑 같은것들은 -1해준다.
            For Each DR As DataRow In Me.DT.Select("정렬번호 like '" & MN & "%' and 정렬번호 <= '" & N정렬번호 & "'")
                MN = DR("정렬번호").Substring(0, 6)
                SN = DR("정렬번호").Substring(6)
                DR("정렬번호") = MN & Format(SN - 1, "0000")   '//원래번호-1해준다.
            Next
            '//
            NR.정렬번호 = N정렬번호
            Dim AR As Integer = Me.view1.ActiveSheet.ActiveRowIndex
            Me.DT.AddDetail_CableRow(NR)
            Me.view1.ActiveSheet.ActiveRowIndex = AR

        Else   '//전주번호정렬법이다 이것은 정렬이 별도로 존재한다.
            MsgBox("번호형식으로 정렬되어있는 데이터입니다" & vbCrLf & "이데이터는 [한줄삽입]이 되지않습니다.", MsgBoxStyle.Information, "확인")
            Me.Sorted = ESorted.CANT
            'Me.bt_addrow.PerformClick()   '//한줄추가화럴ㅇ()
        End If
    End Sub


    Private Sub oolStripMenuItemipMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles oolStripMenuItem.Click
        Me.ToolStripButton2.PerformClick()
    End Sub

    Private Sub ToolStripButton3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
        Process.Start(HomePage)
    End Sub

    Private Sub ToolStripButton5_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click
        Me.Close()
    End Sub

    Private Sub bt_save_all_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_save_all.Click

        Dim a As New SaveFileDialog
        a.Filter = "[모든데이터내보내기] 엑셀 워크시트파일(*.XLS)|*.XLS"
        a.FilterIndex = 0
        a.Title = "저장할 엑셀 파일을 지정하세요"
        If a.ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
            Dim msg As New System.Text.StringBuilder
            Me.view1.SaveExcel(a.FileName, FarPoint.Excel.ExcelSaveFlags.SaveAsViewed)
            msg.AppendLine("내보내진 파일은 기본값으로 [시트보호]가 되어있습니다")
            msg.AppendLine()
            msg.AppendLine()
            msg.AppendLine("[시트보호] 상태에서는 시트를 편집할 수 없습니다")
            msg.AppendLine()
            msg.AppendLine("[시트보호]를 해제하려면  해당파일을 엑셀에서 불러온후")
            msg.AppendLine("[도구]-[보호]-[시트보호해제]를 클릭하세요")
            MsgBox(msg.ToString, MsgBoxStyle.Information, "시트보호")
        End If
    End Sub

    Private Sub bt_save_current_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_save_current.Click

        Dim a As New SaveFileDialog
        a.Filter = "[현재데이터내보내기] 엑셀 워크시트파일(*.XLS)|*.XLS"
        a.FilterIndex = 0
        a.Title = "저장할 엑셀 파일을 지정하세요"
        If a.ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
            Dim msg As New System.Text.StringBuilder
            Me.view1.SaveExcel(a.FileName, FarPoint.Excel.ExcelSaveFlags.SaveAsFiltered)
            msg.AppendLine("내보내진 파일은 기본값으로 [시트보호]가 되어있습니다")
            msg.AppendLine()
            msg.AppendLine()
            msg.AppendLine("[시트보호] 상태에서는 시트를 편집할 수 없습니다")
            msg.AppendLine()
            msg.AppendLine("[시트보호]를 해제하려면  해당파일을 엑셀에서 불러온후")
            msg.AppendLine("[도구]-[보호]-[시트보호해제]를 클릭하세요")
            MsgBox(msg.ToString, MsgBoxStyle.Information, "시트보호")
        End If
    End Sub


    Private Sub outsalldatae_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles outsalldatae.Click
        Me.bt_save_all.PerformClick()
    End Sub

    Private Sub savecurrentdata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles savecurrentdata.Click
        Me.bt_save_current.PerformClick()
    End Sub

    Private Sub AddEpoleJJ_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Validated
        Me.view1.Focus()
        Me.view1.Focus()
    End Sub

    Private Sub bt_find_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_find.Click
        CHk_Modify()
        Display_Data()
    End Sub

    Private Sub bt_datasort_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_datasort.Click
        Dim 번호 As String
        Dim 번호B, 번호b2 As System.Text.StringBuilder
        Me.pbar.Minimum = 0
        Me.pbar.Maximum = Me.IreaDataSet1.jjungtable.Rows.Count - 1
        Me.pbar.Value = 0
        Dim Cidx As Int16 = 0
        Dim Carray As ArrayList
        For Each dr As ireaDataSet.jjungtableRow In Me.IreaDataSet1.jjungtable.Rows
            번호 = (dr.번호1 & dr.번호2 & dr.번호3 & dr.번호4 & dr.번호5)
            If 번호 <> "" Then
                Cidx = 0
                번호B = New System.Text.StringBuilder
                번호b2 = New System.Text.StringBuilder
                Carray = New ArrayList
                For Each C As Char In 번호.ToCharArray
                    If Char.IsLetter(C) Then
                        Carray.Add(C) '//문자위치와 문자를 저장한다.
                        번호B.Append("@")   '//문자는 @로 변환한다.
                    Else
                        번호B.Append(C) '//숫자는 바로 저장해버린다.
                    End If
                    Cidx += 1
                Next
                For Each 번호s As String In 번호B.ToString.Split("@")
                    번호b2.Append(Format(Val(번호s), "000").ToString & "@")   '/3자리로바꾼후 문자열을 붙인다
                Next
                번호b2.Remove(번호b2.Length - 1, 1) '//쓰레기제거
                번호 = 번호b2.ToString
                For Each c As Char In Carray  '//문자와 위치가 있다
                    Cidx = 번호.IndexOf("@")
                    If Cidx <> -1 Then 번호 = 번호.Substring(0, Cidx) & c & 번호.Substring(Cidx + 1)
                Next
                dr.정렬번호 = dr.선로명 & CStr(번호.ToUpper.Replace("K", "0")).Replace("G", "0")
                If Me.pbar.Value < Me.pbar.Maximum Then Me.pbar.Value += 1
            Else   '//번호에 아무것도 없는경우
                dr.정렬번호 = dr.선로명 & "0"                    'If SORTNULL Then dr.정렬번호 = dr.선로명 & "0"
            End If
        Next
        NOTICE("정렬이 완료되었습니다", Me.lb_msg)
    End Sub

    Private Sub servoolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles servoolStripMenuItem.Click
        Dim Frow, Fcol As Integer
        Me.view1.Search(Me.view1.ActiveSheetIndex, InputBox("선택된 열에서 검색할 문자를 입력하세요."), False, False, False, True, True, False, False, 0, 0, Frow, Fcol)
        If Frow >= 0 AndAlso Fcol >= 0 Then '//검색됫다면
            Me.view1.ActiveSheet.SetActiveCell(Frow, Fcol)
            SendKeys.Send("{ENTER}")
        End If
    End Sub

    Private Sub cm_RenewNum_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cm_RenewNum.Click
        ReNum(Me.IreaDataSet1.jjungtable, "번호", Me.pbar)
    End Sub

    Private Sub vripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbt_vselall.Click
        For Each A As DataRow In Me.IreaDataSet1.Detail_Cable.Rows
            A("출력") = True
        Next
    End Sub

    Private Sub cbt_vusell_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbt_vusell.Click
        For Each A As DataRow In Me.IreaDataSet1.Detail_Cable.Rows
            A("출력") = False
        Next
    End Sub

    Private Sub cbt_vselrev_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbt_vselrev.Click
        For Each A As DataRow In Me.IreaDataSet1.Detail_Cable.Rows
            A("출력") = Not A("출력")
        Next
    End Sub

    Private Sub bt_colsizesave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_colsizesave.Click
        Me.view1.ASetting_Save(False, viewTag)
    End Sub

    Private Sub bt_seldel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_seldel.Click
        For i As Integer = Me.view1.ActiveSheet.RowCount - 1 To 0 Step -1
            If Me.view1.ActiveSheet.Cells(i, Me.view1.ACheckBox_ColIndex).Value = True Then Me.view1.ActiveSheet.Rows(i).Remove()
        Next
    End Sub

    Private Sub view1_Arin_Before_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles view1.Arin_Before_KeyDown
        Select Case e.KeyCode
            Case Keys.Insert '//삽입
                Me.bt_insertrow.PerformClick()
                'Me.bt_addrow.PerformClick()
            Case Keys.Enter '/마지막줄에 마지막 열이엿으면 bt_insertrow

                With Me.view1.ActiveSheet
                    Select Case .ActiveColumn.DataField.ToUpper
                        Case "관리구", "전산번호", "HA단자명", "HB단자명", "HADL", "HA구간", "HBDL", "DB구간", _
                        "S0번호2", "S0번호3", "S0번호4", _
                        "S1번호2", "S1번호3", "S1번호4", _
                        "S2번호2", "S2번호3", "S2번호4", _
                        "S3번호2", "S3번호3", "S3번호4", _
                           "S4번호2", "S4번호3", "S4번호4", _
                        "HASS", "HBSS", "시공년월", "시공회사", "공사번호", "감독자", "S0번호1", "S1번호1", "S2번호1", "S3번호1", "S4번호1", "S0SW명", "S0수용가", "S1SW명", "S2SW명", "S3SW명", "S4SW명", "S1위치", "S2위치", "S2위치", "S4위치", "비고1", "비고2", "비고3", "비고4", "비고5", "비고6"
                            If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then
                                .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            End If
                            'Case "HADL"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("HASS")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("HASS")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "HA구간"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("HASS")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("HASS")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("HADL")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("HADL")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "HBDL"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("HBSS")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("HBSS")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "HB구간"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("HBSS")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("HBSS")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("HBDL")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("HBDL")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "S0번호2"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("S0번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("S0번호1")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "S0번호3"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("S0번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("S0번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("S0번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("S0번호2")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "S0번호4"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("S0번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("S0번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("S0번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("S0번호2")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("S0번호3")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("S0번호3")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If


                            'Case "s1번호2"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s1번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s1번호1")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "s1번호3"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s1번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s1번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s1번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s1번호2")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "s1번호4"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s1번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s1번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s1번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s1번호2")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s1번호3")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s1번호3")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "s2번호2"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s2번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s2번호1")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "s2번호3"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s2번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s2번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s2번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s2번호2")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "s2번호4"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s2번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s2번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s2번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s2번호2")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s2번호3")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s2번호3")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If

                            'Case "s3번호2"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s3번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s3번호1")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "s3번호3"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s3번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s3번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s3번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s3번호2")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "s3번호4"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s3번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s3번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s3번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s3번호2")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s3번호3")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s3번호3")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If

                            'Case "s4번호2"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s4번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s4번호1")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "s4번호3"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s4번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s4번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s4번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s4번호2")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If
                            'Case "s4번호4"  '//번호2
                            '    If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '        If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s4번호1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s4번호1")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s4번호2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s4번호2")).Text AndAlso _
                            '        .Cells(.ActiveRowIndex, Me.view1.ColIndex2("s4번호3")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("s4번호3")).Text Then
                            '            .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '        End If
                            '    End If

                            '    Case "3"  '//번호3
                            '        If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '            If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("1")).Text AndAlso _
                            '               .Cells(.ActiveRowIndex, Me.view1.ColIndex2("2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("2")).Text Then
                            '                .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '            End If
                            '        End If
                            '    Case "4"  '//번호4
                            '        If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '            If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("1")).Text AndAlso _
                            '               .Cells(.ActiveRowIndex, Me.view1.ColIndex2("2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("2")).Text AndAlso _
                            '               .Cells(.ActiveRowIndex, Me.view1.ColIndex2("3")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("3")).Text Then
                            '                .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '            End If
                            '        End If
                            '    Case "5"  '//번호5
                            '        If .ActiveCell.Text = "" AndAlso .ActiveRowIndex >= 1 Then '//선로명,전주번호1이 같다면 2번 복사
                            '            If .Cells(.ActiveRowIndex, Me.view1.ColIndex2("1")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("1")).Text AndAlso _
                            '               .Cells(.ActiveRowIndex, Me.view1.ColIndex2("2")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("2")).Text AndAlso _
                            '               .Cells(.ActiveRowIndex, Me.view1.ColIndex2("3")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("3")).Text AndAlso _
                            '               .Cells(.ActiveRowIndex, Me.view1.ColIndex2("4")).Text = .Cells(.ActiveRowIndex - 1, Me.view1.ColIndex2("4")).Text Then
                            '                .ActiveCell.Text = .Cells(.ActiveRowIndex - 1, .ActiveColumnIndex).Text
                            '            End If
                            '        End If
                    End Select
                End With
        End Select
    End Sub

    Private Sub view1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles view1.KeyDown
        view1_Arin_AddLog(sender, "원래뷰에서의 keydown 열번호=" & Me.view1.ActiveSheet.ActiveColumnIndex)
    End Sub

    Private Sub 열너비초기화ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 열너비초기화ToolStripMenuItem.Click
        For c As Integer = 1 To view1_Sheet1.ColumnCount
            view1_Sheet1.Columns(c - 1).Width = 100
        Next
        Application.DoEvents()
    End Sub
End Class