예제 #1
0
        private static void ChangeFontStyle(TXT_ROOM item)
        {
            switch (item.STATES)
            {
            case "1":
                GradientStopCollection gc = new GradientStopCollection();
                gc.Add(new GradientStop(Color.FromRgb(255, 166, 0), 0));
                gc.Add(new GradientStop(Color.FromRgb(249, 41, 0), 0.5));
                gc.Add(new GradientStop(Color.FromRgb(255, 166, 0), 1));

                LinearGradientBrush gradientBrush   = new LinearGradientBrush(gc);
                SolidColorBrush     solidColorBrush = new SolidColorBrush(Color.FromRgb(249, 41, 0));

                item.txtroomnum.Fill   = gradientBrush;
                item.txtroomnum.Stroke = solidColorBrush;

                item.txtlanguage.Fill   = gradientBrush;
                item.txtlanguage.Stroke = solidColorBrush;

                item.txtmorning.Fill   = gradientBrush;
                item.txtmorning.Stroke = solidColorBrush;
                break;

            case "0":
                item.txtroomnum.Fill   = Brushes.White;
                item.txtroomnum.Stroke = Brushes.Black;

                item.txtlanguage.Fill   = Brushes.White;
                item.txtlanguage.Stroke = Brushes.Black;

                item.txtmorning.Fill   = Brushes.White;
                item.txtmorning.Stroke = Brushes.Black;
                break;
            }
        }
예제 #2
0
        private static void ChangeFontStyle(TXT_ROOM item)
        {
            switch (item.STATES)
            {
                case "1":
                    GradientStopCollection gc = new GradientStopCollection();
                    gc.Add(new GradientStop(Color.FromRgb(255, 166, 0), 0));
                    gc.Add(new GradientStop(Color.FromRgb(249, 41, 0), 0.5));
                    gc.Add(new GradientStop(Color.FromRgb(255, 166, 0), 1));

                    LinearGradientBrush gradientBrush = new LinearGradientBrush(gc);
                    SolidColorBrush solidColorBrush = new SolidColorBrush(Color.FromRgb(249, 41, 0));

                    item.txtroomnum.Fill = gradientBrush;
                    item.txtroomnum.Stroke = solidColorBrush;

                    item.txtlanguage.Fill = gradientBrush;
                    item.txtlanguage.Stroke = solidColorBrush;

                    item.txtmorning.Fill = gradientBrush;
                    item.txtmorning.Stroke = solidColorBrush;
                    break;
                case "0":
                    item.txtroomnum.Fill = Brushes.White;
                    item.txtroomnum.Stroke = Brushes.Black;

                    item.txtlanguage.Fill = Brushes.White;
                    item.txtlanguage.Stroke = Brushes.Black;

                    item.txtmorning.Fill = Brushes.White;
                    item.txtmorning.Stroke = Brushes.Black;
                    break;
            }
        }