123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Windows.Forms;
- using IntelligentControlForsx.Code;
- namespace IntelligentControlForsx.MyControls
- {
- public partial class BottomOld : UserControl
- {
- Dictionary<string, Color> mouseEnterDic = new Dictionary<string, Color>();
- Dictionary<string, Color> mouseLeaveDic = new Dictionary<string, Color>();
- public BottomOld()
- {
- InitializeComponent();
- if (!this.DesignMode)
- {
- mouseEnterDic.Add(lblAll.Name, Color.FromArgb(0, 148, 220));
- mouseEnterDic.Add(lblFC.Name, Color.FromArgb(0, 148, 220));
- mouseEnterDic.Add(lblNSS.Name, Color.FromArgb(0, 148, 220));
- mouseEnterDic.Add(lblMHS.Name, Color.FromArgb(0, 148, 220));
- mouseEnterDic.Add(lblQS.Name, Color.FromArgb(0, 148, 220));
- mouseEnterDic.Add(lblSBQ.Name, Color.FromArgb(0, 148, 220));
- mouseEnterDic.Add(lblXS.Name, Color.FromArgb(0, 148, 220));
- mouseEnterDic.Add(lblGF.Name, Color.FromArgb(1, 200, 115));
- mouseEnterDic.Add(lblDWK.Name, Color.FromArgb(1, 200, 115));
- mouseEnterDic.Add(lblPL.Name, Color.FromArgb(1, 200, 115));
- mouseEnterDic.Add(lblXH.Name, Color.FromArgb(1, 200, 115));
- mouseEnterDic.Add(lblMCH.Name, Color.FromArgb(1, 200, 115));
- mouseLeaveDic.Add(lblAll.Name, Color.FromArgb(6, 34, 62));
- mouseLeaveDic.Add(lblFC.Name, Color.FromArgb(0, 78, 140));
- mouseLeaveDic.Add(lblNSS.Name, Color.FromArgb(0, 78, 140));
- mouseLeaveDic.Add(lblMHS.Name, Color.FromArgb(0, 78, 140));
- mouseLeaveDic.Add(lblQS.Name, Color.FromArgb(0, 78, 140));
- mouseLeaveDic.Add(lblSBQ.Name, Color.FromArgb(0, 78, 140));
- mouseLeaveDic.Add(lblXS.Name, Color.FromArgb(0, 78, 140));
- mouseLeaveDic.Add(lblGF.Name, Color.FromArgb(1, 112, 115));
- mouseLeaveDic.Add(lblDWK.Name, Color.FromArgb(1, 112, 115));
- mouseLeaveDic.Add(lblPL.Name, Color.FromArgb(1, 112, 115));
- mouseLeaveDic.Add(lblXH.Name, Color.FromArgb(1, 112, 115));
- mouseLeaveDic.Add(lblMCH.Name, Color.FromArgb(1, 112, 115));
- defalutLable = new Label();
- }
- }
- Label defalutLable;
- [Browsable(true), Category("Appearance")]
- public Label DefaultLable
- {
- get
- {
- return defalutLable;
- }
- set
- {
- if (!this.DesignMode)
- {
- if (defalutLable.Name != null && defalutLable.Name.Trim() != "")
- {
- value.BackColor = mouseEnterDic[value.Name]; ;
- value.Height = 46;
- value.Cursor = Cursors.Default;
- defalutLable.BackColor = mouseLeaveDic[defalutLable.Name];
- defalutLable.Height = 37;
- defalutLable.Cursor = System.Windows.Forms.Cursors.Hand;
- }
-
- }
- defalutLable = value;
- }
- }
- private void lbl_MouseEnter(object sender, System.EventArgs e)
- {
- if (!this.DesignMode)
- {
- Label lable = (Label)sender;
- lable.Height = 46;
- lable.BackColor = mouseEnterDic[lable.Name];
- }
- }
- private void lbl_MouseLeave(object sender, System.EventArgs e)
- {
- if (!this.DesignMode)
- {
- Label lable = (Label)sender;
- if (defalutLable.Name != lable.Name)
- {
- lable.Height = 37;
- lable.BackColor = mouseLeaveDic[lable.Name];
- }
- }
- }
- public event EventHandler MyClick;
- private void lbl_Click(object sender, System.EventArgs e)
- {
- if (!this.DesignMode)
- {
- Label lable = (Label)sender;
- MyClick(lable.Tag, e);
- DefaultLable = lable;
- }
- }
- }
- }
|