Option Strict Off
Public Class frmSettingDB

    Private Sub frmSettingDB_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
        If Asc(e.KeyChar) = Keys.Enter Then
            SendKeys.Send("{tab}")
        End If
    End Sub



    Private Sub frmSettingDB_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        tServer.Text = GetSetting("SPKBarangImportir", "Database", "Nama Server", "") 'ambil nilai dr registry, jika blm ada isi dgn karakter kosong ""
        tDatabase.Text = GetSetting("SPKBarangImportir", "Database", "Nama Database", "")
        tUser.Text = GetSetting("SPKBarangImportir", "Database", "User", "")
        tPassword.Text = GetSetting("SPKBarangImportir", "Database", "Password", "")
        tPort.Text = GetSetting("SPKBarangImportir", "Database", "Port", "")

    End Sub

    Private Sub btnSimpan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSimpan.Click

        If MsgBox("Setting Database Di Simpan ???", vbYesNo + vbQuestion + vbDefaultButton2, "Konfirmasi") = vbYes Then
            SaveSetting("SPKBarangImportir", "Database", "Nama Server", Trim(tServer.Text))
            SaveSetting("SPKBarangImportir", "Database", "Nama Database", Trim(tDatabase.Text))
            SaveSetting("SPKBarangImportir", "Database", "User", Trim(tUser.Text))
            SaveSetting("SPKBarangImportir", "Database", "Password", Trim(tPassword.Text))
            SaveSetting("SPKBarangImportir", "Database", "Port", Trim(tPort.Text))
            Me.Close()
            Call Koneksi()
        End If
    End Sub

    Private Sub btnkeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkeluar.Click

        Me.Close()
        Call Koneksi()
    End Sub

    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub

    Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click

    End Sub
End Class