using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace TradeIdeas.TIProGUI.Charting.Controls.ChartMenuToolBar { [System.ComponentModel.DesignerCategory("")] public class MenuPictureBox : PictureBox { public Image LightImage { get; set; } public Image DarkImage { get; set; } public ToolTip _toolTip { get; set; } public string ToolTipText { get { return null; } set { // The heart menu tooltip is changed onclick, only new it up once so we don't get multiple tooltips displayed on hover if (_toolTip == null) _toolTip = new ToolTip(); _toolTip.SetToolTip(this, value); } } public MenuPictureBox() { Height = 18; Width = 18; BackColor = Color.Transparent; Padding = new Padding(0, 0, 1, 1); SetStyle(ControlStyles.Selectable, false); } public bool IsDarkTheme { get; set; } public virtual void SetTheme(Color backColor) { IsDarkTheme = backColor.IsDark(); Image = IsDarkTheme ? DarkImage : LightImage; } } }