コード例 #1
0
        private void Lbl_MouseEnter(object sender, EventArgs e)
        {
            Label       lbl    = (Label)sender;
            SymbolValue symbol = (SymbolValue)lbl.Tag;

            lbl.Image = FontImageHelper.CreateImage(symbol.Symbol + (int)symbol.SymbolType * 100000, 28, UIColor.Blue);
        }
コード例 #2
0
ファイル: UIFontImages.cs プロジェクト: yhuse/SunnyUI
        private void Lbl_MouseLeave(object sender, EventArgs e)
        {
            Label       lbl    = (Label)sender;
            SymbolValue symbol = (SymbolValue)lbl.Tag;

            if (symbol.IsRed)
            {
                return;
            }
            lbl.Image = FontImageHelper.CreateImage(symbol.Symbol + (int)symbol.SymbolType * 100000, 28, UIFontColor.Primary);
        }
コード例 #3
0
        private Label CreateLabel(int icon, UISymbolType symbolType)
        {
            Label lbl = new Label
            {
                AutoSize   = false,
                Size       = new Size(32, 32),
                ForeColor  = UIColor.Blue,
                Image      = FontImageHelper.CreateImage(icon + (int)symbolType * 100000, 28, UIFontColor.Primary),
                ImageAlign = ContentAlignment.MiddleCenter,
                TextAlign  = ContentAlignment.MiddleLeft,
                Margin     = new Padding(2)
            };

            lbl.Click      += lbl_DoubleClick;
            lbl.MouseEnter += Lbl_MouseEnter;
            lbl.MouseLeave += Lbl_MouseLeave;
            lbl.Tag         = new SymbolValue()
            {
                Symbol = icon, SymbolType = symbolType
            };
            return(lbl);
        }
コード例 #4
0
ファイル: UIFontImages.cs プロジェクト: yhuse/SunnyUI
        private void SetLabelFilter(Label lbl)
        {
            SymbolValue symbol = (SymbolValue)lbl.Tag;

            if (textBox1.Text.IsNullOrEmpty() || !symbol.Name.Contains(textBox1.Text))
            {
                if (symbol.IsRed)
                {
                    lbl.Image = FontImageHelper.CreateImage(symbol.Symbol + (int)symbol.SymbolType * 100000, 28, UIFontColor.Primary);
                }

                symbol.IsRed = false;
            }
            else
            {
                if (!symbol.IsRed)
                {
                    lbl.Image = FontImageHelper.CreateImage(symbol.Symbol + (int)symbol.SymbolType * 100000, 28, UIColor.Red);
                }

                symbol.IsRed = true;
                findCount++;
            }
        }