Exemplo n.º 1
0
        //Button控件click事件,切换前景颜色,需要两个标志位
        public static void Click_ChangeForeColor_Two_Address(Control control, int addressOn, int addressOff, Color oriColor, Color changeColor)
        {
            bool on  = Class_ShareMem.Get_M(addressOn) == 1;
            bool off = Class_ShareMem.Get_M(addressOff) == 1;

            if (on)
            {
                control.BackColor = changeColor;
                Class_ShareMem.Set_M(addressOn, false);
            }
            if (off)
            {
                control.BackColor = oriColor;
                Class_ShareMem.Set_M(addressOn, false);
            }
        }
Exemplo n.º 2
0
        //Button控件click事件,切换背景图片,需要两个标志位
        public static void Click_ChangeBackgroundImage_Two_Address(Control control, int addressOn, int addressOff, Image oriImage, Image changeImage)
        {
            bool on  = Class_ShareMem.Get_M(addressOn) == 1;
            bool off = Class_ShareMem.Get_M(addressOff) == 1;

            if (on)
            {
                control.BackgroundImage = changeImage;
                Class_ShareMem.Set_M(addressOn, false);
            }
            if (off)
            {
                control.BackgroundImage = oriImage;
                Class_ShareMem.Set_M(addressOn, false);
            }
        }