|
Public Class frmSettings
Dim con As Connection = Form1.selcon
Private Sub frmSettings_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
txtName.Text = con.Name
txtAddress.Text = con.FullAddress
cbPrefCon.SelectedIndex = con.PrefCon
If con.PromptForCredentials = 0 Then
chkCred.Checked = True
Else
chkCred.Checked = False
End If
lblTC.Text = con.TimesConnected
If con.LastConnect = #1/1/1900# Or con.LastConnect = #12:00:00 AM# Then
lblLC.Text = Nothing
Else
lblLC.Text = con.LastConnect
End If
End Sub
Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
Me.Close()
End Sub
Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Form1.TreeView1.Nodes.Remove(con)
con.Name = txtName.Text
con.Text = con.Name
con.FullAddress = txtAddress.Text
con.PrefCon = cbPrefCon.SelectedIndex
con.PromptForCredentials = Not chkCred.Checked
con.SaveToReg()
Form1.TreeView1.Nodes.Add(con)
Form1.TreeView1.Sort()
Form1.TreeView1.Update()
Me.Close()
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.