Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Last active February 27, 2018 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fhernd/78026265d9b9dc6a2e920fce296eed2f to your computer and use it in GitHub Desktop.
Save Fhernd/78026265d9b9dc6a2e920fce296eed2f to your computer and use it in GitHub Desktop.
Guardar configuración de formularios de una aplicación en C#.
using System;
using System.ComponentModel;
using System.Windows.Forms;
using R706GuardarConfiguracion.Properties;
namespace R706GuardarConfiguracion
{
public partial class Principal : Form
{
public Principal()
{
InitializeComponent();
}
private void btnCambiarConfiguracion_Click(object sender, EventArgs e)
{
Button btnPresionado = sender as Button;
if (btnPresionado != null)
{
txtCampoTexto.BackColor = btnPresionado.BackColor;
Settings.Default.ColorTexto = txtCampoTexto.BackColor;
}
}
protected override void OnClosing(CancelEventArgs evt)
{
base.OnClosing(evt);
Settings.Default.UbicacionVentana = this.Location;
Settings.Default.Save();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment