public void OffDropShadow()
        {
            // Get a reference to the Button.
            CxComboBox ComboBox = this;

            // Initialize a new DropShadowBitmapEffect that will be applied
            // to the Button.
            DropShadowBitmapEffect myDropShadowEffect = new DropShadowBitmapEffect();

            // Set the color of the shadow to Black.
            Color myShadowColor = new Color();

            myShadowColor.ScA        = 1; // Note that the alpha value is ignored by Color property. The Opacity property is used to control the alpha.
            myShadowColor.ScB        = 0;
            myShadowColor.ScG        = 0;
            myShadowColor.ScR        = 0;
            myDropShadowEffect.Color = myShadowColor;

            // Set the direction of where the shadow is cast to 320 degrees.
            myDropShadowEffect.Direction = 0;

            // Set the depth of the shadow being cast.
            myDropShadowEffect.ShadowDepth = 0;

            // Set the shadow softness to the maximum (range of 0-1).
            myDropShadowEffect.Softness = 0;

            // Set the shadow opacity to half opaque or in other words - half transparent.
            // The range is 0-1.
            myDropShadowEffect.Opacity = 0;

            // Apply the bitmap effect to the Button.
            ComboBox.BitmapEffect = myDropShadowEffect;
        }
Пример #2
0
        private void InitializeRoundComboBoxes()
        {
            var RoundComboBoxes = new CxControlLibrary.CxComboBox();

            RoundComboBoxes.HorizontalAlignment = HorizontalAlignment.Center;
            RoundComboBoxes.ReadOnly            = true;
            //RoundComboBoxes.AutoComplete = false;
            //   RoundComboBoxes.IsRound = true;
            RoundComboBoxes.Background = new SolidColorBrush(Color.FromRgb(234, 234, 234));
            RoundComboBoxes.ArrowColor = ColorArr.Gray;
            // RoundComboBoxes.Foreground = RoundComboBoxes.ArrowColor;


            //AddItemComboBox
            RoundComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label   = "Item1",
                Enabled = true,
                Color   = new SolidColorBrush(Colors.Azure),
                Width   = 1000
            });
            RoundComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label   = "Item2",
                Enabled = false,
                Color   = new SolidColorBrush(Colors.Blue),
                Width   = 1000
            });
            RoundComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label   = "Item3",
                Enabled = true,
                Color   = new SolidColorBrush(Colors.BlueViolet),
                Width   = 1000
            });
            RoundComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label   = "Item4",
                Enabled = true,
                Color   = new SolidColorBrush(Colors.DeepSkyBlue),
                Width   = 1000
            });
            RoundComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label   = "Item5",
                Enabled = true,
                Color   = new SolidColorBrush(Colors.DarkViolet),
                Width   = 1000
            });
            RoundComboBoxes.CxStype = CxStype.Round;
            XAMLStackPanel.Children.Add(RoundComboBoxes); //add to Xaml
            RoundComboBoxes.Name       = "RoundComboBoxes";
            RoundComboBoxes.Margin     = new Thickness(5);
            RoundComboBoxes.CxWidth    = 1000;
            RoundComboBoxes.Background = new SolidColorBrush(Color.FromRgb(235, 235, 235));
            RoundComboBoxes.ArrowColor = ColorArr.Blue;
        }
Пример #3
0
        private void InitializeRectComboBoxes()
        {
            var RectComboBoxes = new CxControlLibrary.CxComboBox();

            RectComboBoxes.CxWidth = 100;
            //RectComboBoxes.IsAutoComplete = true;
            RectComboBoxes.HorizontalAlignment = HorizontalAlignment.Center;
            RectComboBoxes.ReadOnly            = false;

            RectComboBoxes.CxStype = CxStype.Rectangle;

            // RectComboBoxes.ReadOnly = true;

            //RectComboBoxes.IsAutoComplete = false;

            //RectComboBoxes.AutoComplete = null;
            // RectComboBoxes.AutoComplete = true;
            // RectComboBoxes.IsRound = false;
            //RectComboBoxes.Background = new SolidColorBrush(Colors.Red);

            //AddItemComboBox
            RectComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label      = "My Item",
                Tag        = "Hey Tag",
                Font       = new FontFamily("Roboto"),
                Color      = new SolidColorBrush(Colors.Blue),
                Enabled    = true,
                DropShadow = true,
                // Color = new SolidColorBrush(Colors.Azure),
                BackColor = new SolidColorBrush(Colors.Black),
                Width     = 100
            });
            RectComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label    = "Item2",
                Enabled  = false,
                Font     = new FontFamily("Roboto"),
                FontSize = 10,
                Color    = new SolidColorBrush(Colors.Blue),
                Width    = 100
            });
            RectComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label   = "Item3",
                Enabled = true,
                Font    = new FontFamily("Roboto"),
                Color   = new SolidColorBrush(Colors.BlueViolet),
                Width   = 100
            });
            RectComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label   = "Item4",
                Enabled = true,
                Font    = new FontFamily("Roboto"),
                Color   = new SolidColorBrush(Colors.DeepSkyBlue),
                Width   = 100
            });
            RectComboBoxes.AddCollection(new CxControlLibrary.CxComboBoxItem()
            {
                Label   = "Item5",
                Enabled = true,
                Font    = new FontFamily("Roboto"),
                Color   = new SolidColorBrush(Colors.DarkViolet),
                Width   = 100
            });

            RectComboBoxes.DropShadow = true;

            XAMLStackPanel.Children.Add(RectComboBoxes); //add to Xaml

            RectComboBoxes.Name       = "RectComboBoxes";
            RectComboBoxes.Margin     = new Thickness(5);
            RectComboBoxes.DropShadow = false;

            /// RectComboBoxes.ArrowColor = ColorArr.Gray;
            RectComboBoxes.Background = new SolidColorBrush(Colors.White);
        }