Imports System.Windows.Forms
Public Class Opzioni
Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
My.Settings.EditorTestoColoreTags = ColoreTags.BackColor
My.Settings.EditorTestoColoreAttributi = ColoreAttributi.BackColor
My.Settings.EditorTestoColoreValori = ColoreValori.BackColor
My.Settings.EditortestoColoreCommenti = ColoreCommenti.BackColor
My.Settings.EditorTestoColoreQuadre = ColoreQuadre.BackColor
My.Settings.FontEditorTesto = FontCodice.Font
Me.DialogResult = System.Windows.Forms.DialogResult.OK
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()
End Sub
Private Sub Opzioni_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ColoreTags.BackColor = My.Settings.EditorTestoColoreTags
ColoreAttributi.BackColor = My.Settings.EditorTestoColoreAttributi
ColoreValori.BackColor = My.Settings.EditorTestoColoreValori
ColoreCommenti.BackColor = My.Settings.EditortestoColoreCommenti
ColoreQuadre.BackColor = My.Settings.EditorTestoColoreQuadre
FontCodice.Font = My.Settings.FontEditorTesto
End Sub
Private Sub btnCambiaColoreTags_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCambiaColoreTags.Click
SelettoreColori.Color = ColoreTags.BackColor
If SelettoreColori.ShowDialog = Windows.Forms.DialogResult.OK Then
ColoreTags.BackColor = SelettoreColori.Color
End If
End Sub
Private Sub btnCambiaColoreAttributi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCambiaColoreAttributi.Click
SelettoreColori.Color = ColoreAttributi.BackColor
If SelettoreColori.ShowDialog = Windows.Forms.DialogResult.OK Then
ColoreAttributi.BackColor = SelettoreColori.Color
End If
End Sub
Private Sub btnCambiaColoreValori_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCambiaColoreValori.Click
SelettoreColori.Color = ColoreValori.BackColor
If SelettoreColori.ShowDialog = Windows.Forms.DialogResult.OK Then
ColoreValori.BackColor = SelettoreColori.Color
End If
End Sub
Private Sub btnCambiaColoreCommenti_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCambiaColoreCommenti.Click
SelettoreColori.Color = ColoreCommenti.BackColor
If SelettoreColori.ShowDialog = Windows.Forms.DialogResult.OK Then
ColoreCommenti.BackColor = SelettoreColori.Color
End If
End Sub
Private Sub btnCambiaColoreQuadre_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCambiaColoreQuadre.Click
SelettoreColori.Color = ColoreQuadre.BackColor
If SelettoreColori.ShowDialog = Windows.Forms.DialogResult.OK Then
ColoreQuadre.BackColor = SelettoreColori.Color
End If
End Sub
Private Sub btnCambiaFontCodice_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCambiaFontCodice.Click
SelettoreFont.Font = FontCodice.Font
If SelettoreFont.ShowDialog = Windows.Forms.DialogResult.OK Then
FontCodice.Font = SelettoreFont.Font
End If
End Sub
Private Sub btnSvuotaSitiRecenti_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSvuotaSitiRecenti.Click
If MsgBox("Cancellare la cronologia dei siti recenti?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
My.Settings.SitiRecenti = Nothing
End If
End Sub
Private Sub btnPredefiniti_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPredefiniti.Click
If MsgBox("Riportare le impostazioni ai valori predefiniti?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
My.Settings.Reset()
Me.Opzioni_Load(Nothing, Nothing)
End If
End Sub
End Class