53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace AgroBase.Forms.IHM.Controls
|
|
{
|
|
public class HmiDiagnosticTabButton : Button
|
|
{
|
|
private bool _selected;
|
|
|
|
public HmiDiagnosticTabButton()
|
|
{
|
|
FlatStyle = FlatStyle.Flat;
|
|
FlatAppearance.BorderSize = 1;
|
|
FlatAppearance.BorderColor = HmiTheme.Border;
|
|
BackColor = HmiTheme.Surface;
|
|
ForeColor = HmiTheme.TextMuted;
|
|
Font = new Font("Segoe UI", 8F);
|
|
Cursor = Cursors.Hand;
|
|
Height = 32;
|
|
Margin = new Padding(1);
|
|
UseVisualStyleBackColor = false;
|
|
}
|
|
|
|
[Category("Estado")]
|
|
public bool Selected
|
|
{
|
|
get { return _selected; }
|
|
set
|
|
{
|
|
_selected = value;
|
|
AplicarEstado();
|
|
}
|
|
}
|
|
|
|
private void AplicarEstado()
|
|
{
|
|
if (_selected)
|
|
{
|
|
BackColor = Color.FromArgb(20, 59, 96);
|
|
ForeColor = HmiTheme.Text;
|
|
FlatAppearance.BorderColor = HmiTheme.Info;
|
|
}
|
|
else
|
|
{
|
|
BackColor = HmiTheme.Surface;
|
|
ForeColor = HmiTheme.TextMuted;
|
|
FlatAppearance.BorderColor = HmiTheme.Border;
|
|
}
|
|
}
|
|
}
|
|
}
|