Public Class Frm_6_Req
    Dim DT지역중분류 As DataTable
    Dim init As Boolean = False

    Public Overrides Function AcceptChanged() As Boolean
        Me.bs.EndEdit()

        Dim drv As DataRowView = bs.Current
        If drv Is Nothing Then Return True

      
        Return True
    End Function

    Private Sub MdiMain_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Me.bs.EndEdit()
        CEnergy.ARINCLASS.SaveLoad_FrmSetting(Me, Me.bs.Position, True)
    End Sub

    Private Sub MdiMain_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        Select Case e.KeyCode
            Case Keys.F12
        End Select
    End Sub

    Private Sub MdiMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        init = False

       
        Me.bs.DataSource = DSET1.tbl_ReqInfo
        If Me.bs.Count = 0 Then bs.AddNew()
        bs.EndEdit()

        Binding_Zone()
        init = True
        Try
            Me.bs.Position = CEnergy.ARINCLASS.Read_LastPos_Frm(Me)
        Catch ex As Exception
            Me.bs.MoveFirst()
        End Try


        Me.Show()
        Application.DoEvents()



    End Sub

  
    Private Sub Binding_Zone()
        'Dim bs_cmb_공조방식 As New BindingSource(DSET1, "tbl_weather")
        'Me.cmb_location.DataSource = bs_cmb_공조방식
        'cmb_location.DisplayMember = "건물위치"
        'cmb_location.ValueMember = "code"
        'Me.cmb_location.DataBindings.Add("selectedvalue", Me.bs, "buildarea")
        'AddHandler cmb_location.KeyDown, AddressOf Cmb_DeleteVal
    End Sub
    Private Sub Cmb_DeleteVal(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
        If e.KeyCode = Keys.Delete Then
            CType(sender, ComboBox).SelectedValue = ""
        End If
    End Sub

   
    Private Sub Bs_CurrentChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bs.CurrentChanged
        If init = False Then Return '//초기화전이면 수행안함

        Me.bs.EndEdit()
        Dim drv As DataRowView = Me.bs.Current
        If drv Is Nothing Then Return

    End Sub

   
    Private Sub Bs_CurrentItemChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles bs.CurrentItemChanged
        Try
            Me.bs.EndEdit()
        Catch ex As Exception

        End Try
    End Sub

  

    Private Sub RibbonButton1_Click(sender As Object, e As EventArgs) Handles RibbonButton1.Click
        AcceptChanged()
    End Sub


End Class