• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.Grid类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Controls.Grid的典型用法代码示例。如果您正苦于以下问题:C# Grid类的具体用法?C# Grid怎么用?C# Grid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Grid类属于System.Windows.Controls命名空间,在下文中一共展示了Grid类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnApplyTemplate

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            Body = GetTemplateChild(BodyName) as Grid;
            Slider = GetTemplateChild(SliderName) as SuperSlider;

            if (Thumb == null)
                Thumb = new ColorSliderThumb();

            SelectedColor = GetTemplateChild(SelectedColorName) as Rectangle;
            
            SizeChanged += UserControl_SizeChanged;

            if (Slider != null)
            {
                Slider.ValueChanged += Slider_ValueChanged;

                if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0)
                    Color = System.Windows.Media.Color.FromArgb(255, 6, 255, 0);
                else
                    UpdateLayoutBasedOnColor();
            }

			IsEnabledVisualStateUpdate();
        }
开发者ID:sheeeng,项目名称:wolwp,代码行数:26,代码来源:ColorSlider.cs


示例2: Evaluate

        // ReSharper restore UnassignedField.Global
        // ReSharper restore MemberCanBePrivate.Global


        public void Evaluate(int SpreadMax)
        {
            UIElementOut.SliceCount = 1;

            if (UIElementOut == null || !(UIElementOut[0] is Grid))
                UIElementOut[0] = new Grid();

            var toRemove = new List<UIElement>();

            ((Grid) UIElementOut[0]).Children.Cast<UIElement>().ToList().ForEach(element =>
            {
                if (!_elementInputs.Where(input => input.IOObject[0] != null).Any(input => input.IOObject[0].Equals(element)))
                    toRemove.Add(element);
            });

            toRemove.ForEach(element => ((Grid) UIElementOut[0]).Children.Remove(element));

            for (var i = 0; i < _elementInputs.SliceCount; i++)
            {
                //if (_elementInputs[i].IOObject[0] == null && ((Grid) UIElementOut[0]).Children[i] != null)
                //    ((Grid) UIElementOut[0]).Children.RemoveAt(i);

                if (_elementInputs[i].IOObject[0] != null && !(((Grid) UIElementOut[0]).Children.Contains(_elementInputs[i].IOObject[0])))
                    ((Grid) UIElementOut[0]).Children.Add(_elementInputs[i].IOObject[0]);
            }
        }
开发者ID:kopffarben,项目名称:VVVV.Packs.UI,代码行数:30,代码来源:WPFGroupNode.cs


示例3: CreateTabItem

 public static TabItem CreateTabItem(WrapPanel headerPanel, Grid textBoxGrid)
 {
     TabItem tabItem = new TabItem();
     tabItem.Header = headerPanel;
     tabItem.Content = textBoxGrid;
     return tabItem;
 }
开发者ID:vasily-kirichenko,项目名称:vsClojure,代码行数:7,代码来源:ReplUserInterfaceFactory.cs


示例4: MainTab

 public MainTab(int page, TabItem newTab, Image newVerso, Image newRecto, Grid canvas, Grid vGrid, Grid rGrid, Button delBtn, ScatterView SV, ScatterViewItem si, Grid vSwipeGrid, Grid rSwipeGrid, Grid vTranslationGrid, Grid rTranslationGrid, Grid vBoxesGrid, Grid rBoxesGrid, TextBlock headerText, SurfaceWindow1.language language)
 {
     _page = page;
     _tab = newTab;
     _verso = newVerso;
     _recto = newRecto;
     _canvas = canvas;
     _vGrid = vGrid;
     _rGrid = rGrid;
     _SVI = si;
     _delButton = delBtn;
     numFingersRecto = 0;
     numFingersVerso = 0;
     fingerPos = new List<Point>();
     avgTouchPoint = new Point(-1, 0);
     _vSwipeGrid = vSwipeGrid;
     _rSwipeGrid = rSwipeGrid;
     _vTranslationGrid = vTranslationGrid;
     _rTranslationGrid = rTranslationGrid;
     _vBoxesGrid = vBoxesGrid;
     _rBoxesGrid = rBoxesGrid;
     _twoPage = true;
     _SV = SV;
     _headerTB = headerText;
     _currentLanguage = language;
     _previousLanguage = _currentLanguage;
     _worker = new Workers(this);
 }
开发者ID:straboulsi,项目名称:fauvel,代码行数:28,代码来源:Tab.cs


示例5: QryptoWirePage

        protected QryptoWirePage()
        {
            Loaded += (sender, args) =>
            {
                SystemTray.IsVisible = false;

                var dc = DataContext as QryptoViewModel;
                if (dc != null)
                {
                    var pageContent = Content as FrameworkElement;
                        if(pageContent == null)
                            return;

                    var rootGrid = new Grid
                    {
                        RowDefinitions = { new RowDefinition { Height = new GridLength(1, GridUnitType.Star) } }
                    };

                    var overlay = new WorkingOverlay();
                    Grid.SetRow(overlay, 1);
                    Grid.SetRow(pageContent, 1);

                    Content = rootGrid;

                    rootGrid.Children.Add(pageContent);
                    rootGrid.Children.Add(overlay);
                }
            };
        }
开发者ID:QRyptoWire,项目名称:qrypto-wire,代码行数:29,代码来源:QryptoWirePage.cs


示例6: ListView_MouseDoubleClick

        private void ListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            
            //InstrumentHierarchyViewModel item = sender as InstrumentHierarchyViewModel;
            ExploreHirachyInstrumentVMWrapper item = ExplorerListView_.SelectedItem as ExploreHirachyInstrumentVMWrapper;

            if (item != null)
            {
                LayoutDocument layoutDoc = new LayoutDocument();
                //int count = this.Parent.ChildrenCount;
                //LayoutDocumentPane pane = new LayoutDocumentPane();
                Grid grid = new Grid();
                grid.Children.Add(item.view());
                layoutDoc.Content = grid;

                layoutDoc.Title = item.ProductName_;

                mainWindow_.DocumentPane_.Children.Add(layoutDoc);
                OutputLogViewModel.addResult(new MessageOutput(item.ProductName_ + " is loaded"));
                
            }
            
            
            //MainWindow.AddCtrlOnMainWindow(item.View_);
        }
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:25,代码来源:InstrumentExplorerViewCtrl.xaml.cs


示例7: AttachControl

        public override bool AttachControl(FilterPropertiesControl control)
        {
            Control = control;

            Grid grid = new Grid();
            int rowIndex = 0;

            TextBlock brightnessText = new TextBlock();
            brightnessText.Text = "Threshold";
            Grid.SetRow(brightnessText, rowIndex++);

            Slider brightnessSlider = new Slider();
            brightnessSlider.Minimum = 0.0;
            brightnessSlider.Maximum = 1.0;
            brightnessSlider.Value = _colorSwapFilter.Threshold;
            brightnessSlider.ValueChanged += brightnessSlider_ValueChanged;
            Grid.SetRow(brightnessSlider, rowIndex++);


            for (int i = 0; i < rowIndex; ++i)
            {
                RowDefinition rd = new RowDefinition();
                grid.RowDefinitions.Add(rd);
            }

            grid.Children.Add(brightnessText);
            grid.Children.Add(brightnessSlider);

            control.ControlsContainer.Children.Add(grid);

            return true;
        }
开发者ID:sachin4203,项目名称:ClassicPhotoEditor,代码行数:32,代码来源:MynewFilter3.cs


示例8: Meter8

        public Meter8()
        {
            var borderBrush = new LinearGradientBrush();
            borderBrush.StartPoint = new Point();
            borderBrush.EndPoint = new Point(1d, 1d);
            borderBrush.GradientStops.Add(new GradientStop() { Color = Colors.White, Offset = 0d });
            borderBrush.GradientStops.Add(new GradientStop() { Color = Colors.White, Offset = 0.4999d });
            borderBrush.GradientStops.Add(new GradientStop() { Color = Color.FromArgb(0xff, 0x84, 0x7B, 0x6C), Offset = 0.5d });
            borderBrush.GradientStops.Add(new GradientStop() { Color = Color.FromArgb(0xff, 0x84, 0x7B, 0x6C), Offset = 1d });
            var border = new Rectangle();
            border.Fill = borderBrush;
            //border.Stroke = new SolidColorBrush(Colors.Black);
            //border.StrokeThickness = 1d;

            var background = new Rectangle();
            background.Fill = new SolidColorBrush(Color.FromArgb(0xff, 0xAD, 0xA7, 0x9D));
            background.Margin = new Thickness(4d);

            var grid = new Grid();
            grid.Children.Add(border);
            grid.Children.Add(background);
            grid.Children.Add(_canvas);
            grid.Children.Add(_calibrationCanvas);

            this.Content = grid;

            _label.Text = Value.ToString();
            _label.Foreground = new SolidColorBrush(ForeColor);

            _pointLine.Stroke = new SolidColorBrush(Colors.Red);
            _pointLine.StrokeThickness = 2d;
            this.SizeChanged += Meter_SizeChanged;
        }
开发者ID:Jitlee,项目名称:MonitorProject,代码行数:33,代码来源:Meter8.cs


示例9: Draw

 public override void Draw(Grid g)
 {
     base.Draw(g);
     Rectangle bounds = base.Bounds;
     bounds.X += 0x12;
     bounds.Width = 400;
 }
开发者ID:belsoft,项目名称:traingraph,代码行数:7,代码来源:IconSpeakerGroup.cs


示例10: InjectOverlayIntoMainWindow

        //public static readonly DependencyProperty IsTutorialOverlayCompatibleProperty = DependencyProperty.RegisterAttached("IsTutorialOverlayCompatible", typeof(Boolean), typeof(TutorialManager), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender, IsTutorialOverlayCompatibleChanged));
        //public static void SetIsTutorialOverlayCompatible(UIElement element, Boolean value)
        //{
        //    element.SetValue(IsTutorialOverlayCompatibleProperty, value);
        //}
        //public static Boolean GetIsTutorialOverlayCompatible(UIElement element)
        //{
        //    return (Boolean)element.GetValue(IsTutorialOverlayCompatibleProperty);
        //}
        public static void InjectOverlayIntoMainWindow()
        {
            if (OverlayHasBeenInjected)
            {
                return;
            }

            Window window = Application.Current.MainWindow;

            Grid newRootElement = new Grid();
            newRootElement.Name = "HelpOverlayRoot";
            if (window.Content as UIElement != null)
            {
                UIElement currentContent = (UIElement)window.Content;
                window.Content = null;
                newRootElement.Children.Add(currentContent);
                newRootElement.Children.Add(new HelpOverlayControl());
                window.Content = newRootElement;

                Overlay = (HelpOverlayControl)HelpOverlyHelper.FindChild(newRootElement, "PART_HelpOverlayUserControl");

                OverlayHasBeenInjected = true;
            }
            else
            {
                Console.WriteLine("HelpOverlay cannot inject its overlay control into a window that defines its root as a DataTemplate.  In order to use HelpOverlay, ensure that the current Window's Content property is a UIElement.");
            }
        }
开发者ID:nfriend,项目名称:TutorialOverlay,代码行数:37,代码来源:TutorialManager.cs


示例11: Brique

        //Constructeur
        public Brique(Grid parent, double posX, double posY, bool cassable)
        {
            //Création de l'ellipse
            this._forme = new Rectangle();

            //Ajout au parent
            parent.Children.Add(this._forme);

            //Taille de la Brique
            this._forme.Height = 20;
            this._forme.Width = 60;

            //Position de la Brique
            this._forme.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            this._forme.VerticalAlignment = System.Windows.VerticalAlignment.Top;
            this._forme.Margin = new System.Windows.Thickness(posX, posY, 0, 0);

            this.Cassable = cassable;

            //Couleur de la Brique
            //Couleur de fond
            Thread.Sleep(1);
            Random R = new Random(unchecked((int)DateTime.Now.Ticks));
            SolidColorBrush couleurFond = new SolidColorBrush();
            byte Red = (byte)(R.Next(253) + 1);
            byte Green = (byte)(R.Next(253) + 1);
            byte Blue = (byte)(R.Next(253) + 1);
            //Noire si incassable
            couleurFond.Color = cassable ? Color.FromRgb(Red, Green, Blue) : Color.FromRgb(0, 0, 0);
            this._forme.Fill = couleurFond;
            //Couleur de bordure
            SolidColorBrush couleurBord = new SolidColorBrush();
            couleurBord.Color = Color.FromRgb(255, 255, 255);
            this._forme.Stroke = couleurBord;
        }
开发者ID:mbonitho,项目名称:ClockTwo,代码行数:36,代码来源:Brique.cs


示例12: GetContent

        protected override FrameworkElement GetContent()
        {
            int totalHeight = 0;
            ListBox removeOptions = new ListBox();

            for(int i = 0 ; i < _tree.Items.Count; i ++)
            
                if (_tree.Items[i] is PatternBase)
                {
                    totalHeight += 25; //default height of an item
                    TextBlock pattern = new TextBlock() 
                    {
                        Text = (_tree.Items[i] as PatternBase).BioPatternName,
                        Name = i.ToString(), //store the id as name so we can remove it later...
                        Width = 150
                    };

                    pattern.MouseLeftButtonUp += new MouseButtonEventHandler(RemoveSelectedPattern);
                    removeOptions.Items.Add(pattern);
                }

            Grid grid = new Grid() 
            { 
                Height = totalHeight,
                Width = 170
            };
            grid.Children.Add(removeOptions);
            return grid;
        }
开发者ID:SamuelToh,项目名称:Masters_Degree_Major_Project,代码行数:29,代码来源:PatternRemoveMenu.cs


示例13: Cabecera

        public Cabecera()
        {
            Background = new SolidColorBrush(Colors.White);
            Orientation = Orientation.Vertical;

            var nombreJuego = new TextBlock { Text = "Tres en Línea", FontSize = 78, Foreground = new SolidColorBrush(Colors.Black), HorizontalAlignment = HorizontalAlignment.Center};
            Children.Add(nombreJuego);

            var nuevoJuego = new Button {Content = "Iniciar nuevo Juego", Background = new SolidColorBrush(Colors.Black)};
            nuevoJuego.Tap += nuevoJuego_Tap;
            Children.Add(nuevoJuego);

            Grid resultadoGrid = new Grid{Background = new SolidColorBrush(Colors.White), ShowGridLines = false};

            resultadoGrid.ColumnDefinitions.Add(new ColumnDefinition());
            resultadoGrid.ColumnDefinitions.Add(new ColumnDefinition{Width = new GridLength(2, GridUnitType.Star)});
            resultadoGrid.RowDefinitions.Add(new RowDefinition());

            var labelResultado = new TextBlock { Text = "Resultado:", FontSize = 22, Foreground = new SolidColorBrush(Colors.Black), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
            resultadoGrid.Children.Add(labelResultado);
            Grid.SetColumn(labelResultado, 0);

            resultado = new TextBlock { Text = "En proceso.", FontSize = 22, Foreground = new SolidColorBrush(Colors.Black), HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
            resultadoGrid.Children.Add(resultado);
            Grid.SetColumn(resultado, 1);

            Children.Add(resultadoGrid);
        }
开发者ID:douglaszuniga,项目名称:Gato,代码行数:28,代码来源:Cabecera.cs


示例14: AttachControl

        public override bool AttachControl(FilterPropertiesControl control)
        {
            Control = control;

            Grid grid = new Grid();
            int rowIndex = 0;

            CheckBox distinctEdgesCheckBox = new CheckBox();
            TextBlock textBlock = new TextBlock {Text = AppResources.DistinctEdges};
            distinctEdgesCheckBox.Content = textBlock;
            distinctEdgesCheckBox.IsChecked = _cartoonFilter.DistinctEdges;
            distinctEdgesCheckBox.Checked += distinctEdgesCheckBox_Checked;
            distinctEdgesCheckBox.Unchecked += distinctEdgesCheckBox_Unchecked;
            Grid.SetRow(distinctEdgesCheckBox, rowIndex++);

            for (int i = 0; i < rowIndex; ++i)
            {
                RowDefinition rd = new RowDefinition();
                grid.RowDefinitions.Add(rd);
            }

            grid.Children.Add(distinctEdgesCheckBox);

            control.ControlsContainer.Children.Add(grid);

            return true;
        }
开发者ID:KayNag,项目名称:LumiaImagingSDKSample,代码行数:27,代码来源:MarvelFilter.cs


示例15: showlocations

        private void showlocations()
        {
            foreach (Place p in _vm.Places)
            {
                Grid MyGrid = new Grid();
                MyGrid.RowDefinitions.Add(new RowDefinition());
                MyGrid.RowDefinitions.Add(new RowDefinition());
                MyGrid.Background = new SolidColorBrush(Colors.Transparent);

                BitmapImage bmi = new BitmapImage(new Uri("/Assets/pushpinPhone.png", UriKind.Relative));
                Image img = new Image();
                img.Tag = (p);
                img.Source = bmi;
               
        
                MyGrid.Children.Add(img);


                //Creating a MapOverlay and adding the Grid to it.
                MapOverlay MyOverlay = new MapOverlay();
                MyOverlay.Content = MyGrid;

                MyOverlay.GeoCoordinate = new GeoCoordinate(p.Latitude, p.Longitude);


                MyOverlay.PositionOrigin = new Point(0, 0.5);

                //Creating a MapLayer and adding the MapOverlay to it
                MapLayer MyLayer = new MapLayer();
                MyLayer.Add(MyOverlay);
                mapWithMyLocation.Layers.Add(MyLayer);
            }
        }
开发者ID:landerarnoys,项目名称:Shredder,代码行数:33,代码来源:MainPage.xaml.cs


示例16: CreateControls

        private void CreateControls()
        {
            Grid grid_main = new Grid();
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_main.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            ////////
            // Id Grid
            Grid grid_id = new Grid();
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_id.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_id, 0, 0);

            ////////
            // Id
            TextBlock textBlock_id =
                new TextBlock()
                {
                    VerticalAlignment = VerticalAlignment.Center,
                    Text = (ItemId.HasValue) ? ItemId.ToString() : "NewItem"
                };
            Label label_id = new Label() { Content = "Id:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_id.SetGridRowColumn(textBlock_id, 0, 1);
            grid_id.SetGridRowColumn(label_id, 0, 0);

            ////////
            // Item Grid
            Grid grid_name = new Grid();
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });
            grid_name.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(100.0, GridUnitType.Star) });
            grid_main.SetGridRowColumn(grid_name, 1, 0);

            ////////
            // Item
            m_textBox_name = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = ItemName };
            m_textBox_name.TextChanged += TextBox_Name_TextChanged;
            Label label_name = new Label() { Content = "Item:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_name.SetGridRowColumn(m_textBox_name, 1, 0);
            grid_name.SetGridRowColumn(label_name, 0, 0);

            ////////
            // Description Grid
            Grid grid_description = new Grid();
            grid_description.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_description.ColumnDefinitions.Add(new ColumnDefinition() { Width = GridLength.Auto });
            grid_main.SetGridRowColumn(grid_description, 2, 0);

            ////////
            // Description
            m_textBox_description = new TextBox() { VerticalAlignment = VerticalAlignment.Center, Text = ItemDescription };
            m_textBox_description.TextChanged += TextBox_Description_TextChanged;
            Label label_description = new Label() { Content = "Description:", FontWeight = FontWeights.Bold, VerticalAlignment = VerticalAlignment.Center };
            grid_description.SetGridRowColumn(m_textBox_description, 0, 1);
            grid_description.SetGridRowColumn(label_description, 0, 0);

            ////////
            // Fin
            Content = grid_main;
        }
开发者ID:ianeller-romey,项目名称:GinTub_TLATEOTH,代码行数:60,代码来源:UserControl_Item.cs


示例17: OnApplyTemplate

        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _imageContainer = (Grid)GetTemplateChild("ImageContainer");

			GridSizeChanged();
			ResetGridStateManagement();

			_createAnimation = false;

			if (!DesignerProperties.IsInDesignTool)
			{
				for (var i = 0; i < Rows; i++)
				{
					for (var j = 0; j < Columns; j++)
					{
						CycleImage(i, j);
					}
				}
			}

	        _createAnimation = true;

			ImageCycleIntervalChanged();
			IsFrozenPropertyChanged();

			_changeImageTimer.Tick += ChangeImageTimerTick;
        }
开发者ID:selaromdotnet,项目名称:Coding4FunToolkit,代码行数:29,代码来源:ImageTile.cs


示例18: Plateau

        //Nous avons besoin : lignes, colonnes , score, lignes remplies et quelques effets
        public Plateau(Grid TetrisGrid)
        {
            //État actuel des valeurs , les lignes et les colonnes sont à compter,
            //elles ont déjà été déclarés dans le fichier XAML.
            Lignes = TetrisGrid.RowDefinitions.Count;
            Colonnes = TetrisGrid.ColumnDefinitions.Count;

            Score = 0;
            LignesRemplies = 0;

            BlockControls = new Label[Colonnes, Lignes];
            for (int i = 0; i < Colonnes; i++)
            {
                for (int j = 0; j < Lignes; j++)
                {
                    BlockControls[i, j] = new Label();
                    BlockControls[i, j].Background = Nocolor;
                    BlockControls[i, j].BorderBrush = BlackColor;
                    BlockControls[i, j].BorderThickness = new Thickness(0.3, 0.3, 0.3, 0.3);
                    Grid.SetRow(BlockControls[i, j], j);
                    Grid.SetColumn(BlockControls[i, j], i);
                    TetrisGrid.Children.Add(BlockControls[i, j]);
                }
            }
            Piece = new Piece();
            pieceDessin();
        }
开发者ID:clusson,项目名称:Tetris-WPF,代码行数:28,代码来源:Plateau.cs


示例19: ExamineKeystrokes

        public ExamineKeystrokes()
        {
            Title = "Examine Keystrokes";
            FontFamily = new FontFamily("Courier New");

            Grid grid = new Grid();
            Content = grid;

            // Make one row "auto" and the other fill the remaining space.
            RowDefinition rowdef = new RowDefinition();
            rowdef.Height = GridLength.Auto;
            grid.RowDefinitions.Add(rowdef);
            grid.RowDefinitions.Add(new RowDefinition());

            // Display header text.
            TextBlock textHeader = new TextBlock();
            textHeader.FontWeight = FontWeights.Bold;
            textHeader.Text = strHeader;
            grid.Children.Add(textHeader);

            // Create StackPanel as child of ScrollViewer for displaying events.
            scroll = new ScrollViewer();
            grid.Children.Add(scroll);
            Grid.SetRow(scroll, 1);

            stack = new StackPanel();
            scroll.Content = stack;
        }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:28,代码来源:ExamineKeystrokes.cs


示例20: ModelListViewItem

        public ModelListViewItem() {
            this.Padding = new Thickness(1);
            this.Background = new SolidColorBrush(Colors.Transparent);
            BackgroundRectangle.RadiusX = 5;
            BackgroundRectangle.RadiusY = BackgroundRectangle.RadiusX;

            Highlight.RadiusX = 5;
            Highlight.RadiusY = BackgroundRectangle.RadiusX;
            Highlight.Stroke = Brushes.Black;
            Highlight.StrokeThickness = 1;
            Highlight.Opacity = 0;

            contentLabel.Background = new SolidColorBrush(Colors.Transparent);
            contentLabel.Padding = new Thickness(5);
            contentLabel.Margin = new Thickness(0);
            contentLabel.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            contentLabel.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Stretch;

            //            contentLabel.BorderBrush = new SolidColorBrush(Colors.Black);
            //          contentLabel.BorderThickness = new System.Windows.Thickness(1);


            Grid grid = new Grid();


            grid.Children.Add(BackgroundRectangle);
            grid.Children.Add(Highlight);

            grid.Children.Add(contentLabel);

            base.Content = grid;
            this.MouseDown += new MouseButtonEventHandler(UserControl_MouseLeftButtonDown);
            this.MouseEnter += new MouseEventHandler(ModelListViewItem_MouseEnter);
            this.MouseLeave += new MouseEventHandler(ModelListViewItem_MouseLeave);
        }
开发者ID:sanmadjack,项目名称:MVC.WPF.CSharp,代码行数:35,代码来源:ModelListViewItem.cs



注:本文中的System.Windows.Controls.Grid类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Controls.GridSplitter类代码示例发布时间:2022-05-26
下一篇:
C# Controls.Frame类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap