private void btn_guardar_Click(object sender, EventArgs e) { Apariencia.setearValor("menuPrincipal", this.btn_menuPrincipal.BackColor.ToArgb()); Apariencia.setearValor("textoMenu", this.btn_textoMenu.BackColor.ToArgb()); Apariencia.setearValor("submenu", this.btn_submenu.BackColor.ToArgb()); Apariencia.setearValor("textoSub", this.btn_textoSub.BackColor.ToArgb()); Apariencia.setearValor("submenu1", this.btn_submenu1.BackColor.ToArgb()); Apariencia.setearValor("textoSub1", this.btn_textoSub1.BackColor.ToArgb()); Apariencia.setearValor("textoLeyenda", this.btn_textoLeyendas.BackColor.ToArgb()); Apariencia.setearValor("textoBoton", this.btn_textoBoton.BackColor.ToArgb()); Apariencia.setearValor("estiloFondo", this.cmb_posicionFondo.SelectedIndex); if (this.usarDefecto) { Apariencia.setearValorBool("usarFondo", false); } else if (this.cambioImagen) { this.guardarImagen(); } frm_menu menu = (frm_menu)this.Owner; menu.actualizarColor(); }
public void actualizarColor() { Apariencia.colorDeMenu(this.menu_principal); Apariencia.imagenFormulario(this); Apariencia.colorBotones(new List <Button> { this.btn_caja, this.btn_facturar, this.btn_cerrar, this.btn_salir, this.btn_guia }); }
public frm_apariencia() { InitializeComponent(); this.MenuPrincipal = Apariencia.obtenerValor("menuPrincipal"); this.textoMenu = Apariencia.obtenerValor("textoMenu"); this.subMenu = Apariencia.obtenerValor("submenu"); this.textoSub = Apariencia.obtenerValor("textoSub"); this.subMenu1 = Apariencia.obtenerValor("submenu1"); this.textoSub1 = Apariencia.obtenerValor("textoSub1"); this.textoLeyenda = Apariencia.obtenerValor("textoLeyenda"); this.textoBoton = Apariencia.obtenerValor("textoBoton"); estadoInicial(); }
protected void setearImagen() { if (!Apariencia.obtenerValorBool("usarFondo")) { this.pib_imagen.BackgroundImage = Resources.logo; } else { string archivo = Apariencia.rutaImagen(); if (!String.IsNullOrEmpty(archivo)) { Image diskImage = Image.FromFile(archivo); Image memoryImage = new Bitmap(diskImage); this.pib_imagen.BackgroundImage = memoryImage; diskImage.Dispose(); } } }
protected void guardarImagen() { frm_menu menu = (frm_menu)this.Owner; menu.BackgroundImage.Dispose(); //menu.BackgroundImage = Resources.logo; menu.BackgroundImage = null; string fileName = "custom_background.jpg"; string targetPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\Contifico"; if (!System.IO.Directory.Exists(targetPath)) { System.IO.Directory.CreateDirectory(targetPath); } string destFile = System.IO.Path.Combine(targetPath, fileName); System.IO.File.Copy(this.rutaImagen, destFile, true); Apariencia.setearValorBool("usarFondo", true); }
protected void estiloFondo() { switch (Apariencia.obtenerValor("estiloFondo")) { case 0: this.pib_imagen.BackgroundImageLayout = ImageLayout.Center; this.cmb_posicionFondo.SelectedIndex = 0; break; case 1: this.pib_imagen.BackgroundImageLayout = ImageLayout.Tile; this.cmb_posicionFondo.SelectedIndex = 1; break; case 2: this.pib_imagen.BackgroundImageLayout = ImageLayout.Zoom; this.cmb_posicionFondo.SelectedIndex = 2; break; case 3: this.pib_imagen.BackgroundImageLayout = ImageLayout.Stretch; this.cmb_posicionFondo.SelectedIndex = 3; break; } }