void SetupView3() { try { // Setup tiles options tileView3.BeginUpdate(); tileView3.OptionsTiles.RowCount = 3; tileView3.OptionsTiles.Padding = new Padding(20); tileView3.OptionsTiles.ItemPadding = new Padding(10); tileView3.OptionsTiles.IndentBetweenItems = 20; tileView3.OptionsTiles.ItemSize = new Size(340, 160); tileView3.Appearance.ItemNormal.ForeColor = Color.White; tileView3.Appearance.ItemNormal.BorderColor = Color.Transparent; //Setup tiles template TileViewItemElement leftPanel = new TileViewItemElement(); TileViewItemElement splitLine = new TileViewItemElement(); TileViewItemElement addressCaption = new TileViewItemElement(); TileViewItemElement addressValue = new TileViewItemElement(); TileViewItemElement yearBuiltCaption = new TileViewItemElement(); TileViewItemElement yearBuiltValue = new TileViewItemElement(); TileViewItemElement price = new TileViewItemElement(); TileViewItemElement image = new TileViewItemElement(); TileViewItemElement num = new TileViewItemElement(); tileView3.TileTemplate.Add(leftPanel); tileView3.TileTemplate.Add(splitLine); tileView3.TileTemplate.Add(addressCaption); tileView3.TileTemplate.Add(addressValue); tileView3.TileTemplate.Add(yearBuiltCaption); tileView3.TileTemplate.Add(yearBuiltValue); tileView3.TileTemplate.Add(price); tileView3.TileTemplate.Add(image); tileView3.TileTemplate.Add(num); // leftPanel.StretchVertical = true; leftPanel.Width = 118; leftPanel.TextLocation = new Point(-10, 0); leftPanel.Appearance.Normal.BackColor = Color.FromArgb(58, 166, 101); // splitLine.StretchVertical = true; splitLine.Width = 3; splitLine.TextAlignment = TileItemContentAlignment.Manual; splitLine.TextLocation = new Point(105, 0); splitLine.Appearance.Normal.BackColor = Color.White; // addressCaption.Text = "itemKey"; addressCaption.TextAlignment = TileItemContentAlignment.TopLeft; addressCaption.Appearance.Normal.FontSizeDelta = -1; addressCaption.TextVisible = false; // addressValue.Column = tileView3.Columns["itemKey"]; addressValue.AnchorElement = addressCaption; addressValue.AnchorIndent = 2; addressValue.MaxWidth = 100; addressValue.Appearance.Normal.FontStyleDelta = FontStyle.Bold; addressValue.TextVisible = false; // yearBuiltCaption.TextAlignment = TileItemContentAlignment.TopLeft; yearBuiltCaption.Text = "菜名"; // yearBuiltCaption.AnchorElement = addressValue; // yearBuiltCaption.AnchorIndent = 14; yearBuiltCaption.Appearance.Normal.FontSizeDelta = -1; // yearBuiltValue.Column = tileView3.Columns["itemName"]; yearBuiltValue.AnchorElement = yearBuiltCaption; yearBuiltValue.AnchorIndent = 2; yearBuiltValue.Appearance.Normal.FontStyleDelta = FontStyle.Bold; yearBuiltValue.Appearance.Normal.Font = new Font("Segoe UI Semilight", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); price.Column = tileView3.Columns["sprice"]; // price.TextAlignment = TileItemContentAlignment.BottomLeft; price.AnchorElement = yearBuiltValue; price.AnchorIndent = 2; price.Appearance.Normal.FontStyleDelta = FontStyle.Bold; price.Appearance.Normal.Font = new Font("Segoe UI Semilight", 25.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); // image.Column = tileView3.Columns["itemImgs"]; image.ImageSize = new Size(280, 180); image.ImageAlignment = TileItemContentAlignment.MiddleRight; image.ImageScaleMode = TileItemImageScaleMode.ZoomOutside; image.ImageLocation = new Point(10, 10); // num.Column = tileView3.Columns["num"]; num.TextAlignment = TileItemContentAlignment.BottomLeft; num.TextLocation = new Point(35, 5); num.Appearance.Normal.Font = new Font("Segoe UI Semilight", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); // //tileView3.ColumnSet.GroupColumn = tileView3.Columns["FoodGroupName"]; tileView3.OptionsTiles.Orientation = Orientation.Vertical; //// System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TaoCanFoodForm)); DevExpress.Utils.ContextButton contextButton1 = new DevExpress.Utils.ContextButton(); DevExpress.Utils.ContextButton contextButton2 = new DevExpress.Utils.ContextButton(); DevExpress.Utils.ContextButton contextButton3 = new DevExpress.Utils.ContextButton(); // this.tileView3.ContextButtonOptions.BottomPanelColor = System.Drawing.Color.FromArgb(((int)(((byte)(150)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); // this.tileView3.ContextButtonOptions.BottomPanelPadding = new System.Windows.Forms.Padding(10); this.tileView3.ContextButtonOptions.BottomPanelColor = System.Drawing.Color.Transparent; contextButton1.AlignmentOptions.Panel = DevExpress.Utils.ContextItemPanel.Bottom; contextButton1.Id = new System.Guid("268d6cbb-1a66-45df-8bcf-b78da8e5f6b6"); contextButton1.ImageOptions.Image = global::DianDianClient.Properties.Resources.remove_32x321; contextButton1.Name = "contextButton1"; contextButton1.Visibility = DevExpress.Utils.ContextItemVisibility.Visible; contextButton2.AlignmentOptions.Panel = DevExpress.Utils.ContextItemPanel.Bottom; contextButton2.AppearanceNormal.Font = new Font("Segoe UI Semilight", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); contextButton2.AppearanceNormal.ForeColor = System.Drawing.Color.White; contextButton2.AppearanceNormal.Options.UseFont = true; contextButton2.AppearanceNormal.Options.UseForeColor = true; contextButton2.AppearanceHover.Font = new Font("Segoe UI Semilight", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); contextButton2.AppearanceHover.ForeColor = System.Drawing.Color.White; contextButton2.AppearanceHover.Options.UseFont = true; contextButton2.AppearanceHover.Options.UseForeColor = true; contextButton2.Caption = " "; contextButton2.Id = new System.Guid("4e4e01ab-05d0-4e61-a986-799123a1585b"); contextButton2.Name = "contextButton2"; contextButton2.Visibility = DevExpress.Utils.ContextItemVisibility.Visible; contextButton3.AlignmentOptions.Panel = DevExpress.Utils.ContextItemPanel.Bottom; contextButton3.Id = new System.Guid("c1138ada-4615-4742-ac92-5d01e0ab43dc"); contextButton3.ImageOptions.Image = global::DianDianClient.Properties.Resources.add_32x32; contextButton3.Name = "contextButton3"; contextButton3.Visibility = DevExpress.Utils.ContextItemVisibility.Visible; this.tileView3.ContextButtons.Add(contextButton1); this.tileView3.ContextButtons.Add(contextButton2); this.tileView3.ContextButtons.Add(contextButton3); this.tileView3.GridControl = this.gridControl3; this.tileView3.Name = "tileView3"; } finally { tileView3.EndUpdate(); } }
void SetupView() { try { // Setup tiles options tileView1.BeginUpdate(); tileView1.OptionsTiles.RowCount = 3; tileView1.OptionsTiles.Padding = new Padding(20); tileView1.OptionsTiles.ItemPadding = new Padding(10); tileView1.OptionsTiles.IndentBetweenItems = 20; tileView1.OptionsTiles.ItemSize = new Size(240, 150); tileView1.Appearance.ItemNormal.ForeColor = Color.White; tileView1.Appearance.ItemNormal.BorderColor = Color.Transparent; tileView1.Appearance.ItemNormal.BackColor = Color.Transparent; //Setup tiles template TileViewItemElement leftPanel = new TileViewItemElement(); TileViewItemElement splitLine = new TileViewItemElement(); TileViewItemElement addressCaption = new TileViewItemElement(); TileViewItemElement addressValue = new TileViewItemElement(); TileViewItemElement yearBuiltCaption = new TileViewItemElement(); TileViewItemElement yearBuiltValue = new TileViewItemElement(); TileViewItemElement price = new TileViewItemElement(); TileViewItemElement image = new TileViewItemElement(); TileViewItemElement state = new TileViewItemElement(); tileView1.TileTemplate.Add(leftPanel); tileView1.TileTemplate.Add(splitLine); tileView1.TileTemplate.Add(addressCaption); tileView1.TileTemplate.Add(addressValue); tileView1.TileTemplate.Add(yearBuiltCaption); tileView1.TileTemplate.Add(yearBuiltValue); tileView1.TileTemplate.Add(price); tileView1.TileTemplate.Add(image); tileView1.TileTemplate.Add(state); // leftPanel.StretchVertical = true; leftPanel.Width = 122; leftPanel.TextLocation = new Point(-10, 0); leftPanel.Appearance.Normal.BackColor = Color.FromArgb(58, 166, 101); // splitLine.StretchVertical = true; splitLine.Width = 3; splitLine.TextAlignment = TileItemContentAlignment.Manual; splitLine.TextLocation = new Point(110, 0); splitLine.Appearance.Normal.BackColor = Color.White; // addressCaption.Text = "FoodID"; addressCaption.TextAlignment = TileItemContentAlignment.TopLeft; addressCaption.Appearance.Normal.FontSizeDelta = -1; // addressValue.Column = tileView1.Columns["FoodID"]; addressValue.AnchorElement = addressCaption; addressValue.AnchorIndent = 2; addressValue.MaxWidth = 100; addressValue.Appearance.Normal.FontStyleDelta = FontStyle.Bold; // yearBuiltCaption.Text = "菜名"; yearBuiltCaption.AnchorElement = addressValue; yearBuiltCaption.AnchorIndent = 14; yearBuiltCaption.Appearance.Normal.FontSizeDelta = -1; // yearBuiltValue.Column = tileView1.Columns["FoodName"]; yearBuiltValue.AnchorElement = yearBuiltCaption; yearBuiltValue.AnchorIndent = 2; yearBuiltValue.Appearance.Normal.FontStyleDelta = FontStyle.Bold; yearBuiltValue.Appearance.Normal.Font = new Font("Segoe UI Semilight", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); price.Column = tileView1.Columns["FoodPrice"]; price.TextAlignment = TileItemContentAlignment.BottomLeft; price.Appearance.Normal.Font = new Font("Segoe UI Semilight", 25.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); // image.Column = tileView1.Columns["FoodImage"]; image.ImageSize = new Size(180, 180); image.ImageAlignment = TileItemContentAlignment.MiddleRight; image.ImageScaleMode = TileItemImageScaleMode.ZoomOutside; image.ImageLocation = new Point(10, 10); // state.Column = tileView1.Columns["State"]; state.TextVisible = false; // tileView1.ColumnSet.GroupColumn = tileView1.Columns["FoodGroupName"]; tileView1.OptionsTiles.Orientation = Orientation.Vertical; // DevExpress.Utils.ContextButton contextButton1 = new DevExpress.Utils.ContextButton(); DevExpress.Utils.ContextButton contextButton2 = new DevExpress.Utils.ContextButton(); DevExpress.Utils.ContextButton contextButton3 = new DevExpress.Utils.ContextButton(); this.tileView1.ContextButtonOptions.BottomPanelColor = System.Drawing.Color.FromArgb(((int)(((byte)(179)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.tileView1.ContextButtonOptions.BottomPanelPadding = new System.Windows.Forms.Padding(10); // // contextButton1.Caption = "下架"; contextButton1.ImageOptions.Image = global::DianDianClient.Properties.Resources.offshelf; contextButton2.AlignmentOptions.Position = DevExpress.Utils.ContextItemPosition.Center; contextButton1.AlignmentOptions.Panel = DevExpress.Utils.ContextItemPanel.Bottom; contextButton1.Id = new System.Guid("5679cac7-1f0e-4f93-a9d4-cd3f82547937"); contextButton1.Name = "contextButton1"; // contextButton2.Caption = "contextButton2"; // contextButton2.ImageOptions.Image = global::DianDianClient.Properties.Resources.delete; contextButton3.AlignmentOptions.Position = DevExpress.Utils.ContextItemPosition.Far; contextButton2.AlignmentOptions.Panel = DevExpress.Utils.ContextItemPanel.Bottom; contextButton2.Id = new System.Guid("9a35eabb-9479-4144-a912-725a1da88885"); contextButton2.Name = "contextButton2"; // // contextButton3.Caption = "contextButton3"; contextButton3.AlignmentOptions.Position = DevExpress.Utils.ContextItemPosition.Far; contextButton3.ImageOptions.Image = global::DianDianClient.Properties.Resources.edit; contextButton3.AlignmentOptions.Panel = DevExpress.Utils.ContextItemPanel.Bottom; contextButton3.Id = new System.Guid("d54ff57a-998d-4251-b811-3b17e36c75aa"); contextButton3.Name = "contextButton3"; this.tileView1.ContextButtons.Add(contextButton1); this.tileView1.ContextButtons.Add(contextButton2); this.tileView1.ContextButtons.Add(contextButton3); this.tileView1.GridControl = this.gridControl1; this.tileView1.Name = "tileView1"; } finally { tileView1.EndUpdate(); } }