Created
June 23, 2014 01:13
-
-
Save Fhernd/98c97ede71e05c3ebd94 to your computer and use it in GitHub Desktop.
Control con imagen y resumen de la alcancía.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ===++=== | |
// | |
// OrtizOL | |
// | |
// ===--=== | |
/*============================================================ | |
// | |
// Clase: ControlAlcancia.cs | |
// | |
// Original en: http://goo.gl/w0QxVW | |
// | |
// Propósito: Controles para la presentación de la imagen | |
// de la alcancía. | |
// | |
============================================================*/ | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Drawing; | |
using System.Data; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
namespace Alcancia.GUI | |
{ | |
/// <summary> | |
/// Control que muestra la alcancía y el resumen de monedas agregadas. | |
/// </summary> | |
public partial class ControlAlcancia : UserControl | |
{ | |
#region Constructores | |
/// <summary> | |
/// Crea una instancia del control visual. | |
/// </summary> | |
public ControlAlcancia() | |
{ | |
InitializeComponent(); | |
} | |
#endregion | |
#region Métodos | |
/// <summary> | |
/// Cambia el estado de la alcancía. | |
/// </summary> | |
/// <param name="rota">true si la alcancía está rota, de lo contrario false.</param> | |
/// <param name="dinero">Cantidad de dinero en la alcancía.</param> | |
public void CambiarEstadoAlcancia(Boolean rota, decimal dinero) | |
{ | |
if (rota) | |
{ | |
if (decimal.Zero == dinero) | |
{ | |
pbxAlcancia.Image = Properties.Resources.alcancia_rota_vacia; | |
} | |
else | |
{ | |
pbxAlcancia.Image = Properties.Resources.alcancia_rota; | |
} | |
} | |
else | |
{ | |
pbxAlcancia.Image = Properties.Resources.alcancia_nueva; | |
} | |
} | |
/// <summary> | |
/// Cambia el mensaje del estado de la alcancía. | |
/// </summary> | |
/// <param name="mensaje"></param> | |
public void CambiarMensaje(string mensaje) | |
{ | |
lblEstadoAlcancia.Text = mensaje; | |
} | |
#endregion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment