public void AddTtem(Image i, int index) { TileItem newTile = new TileItem(); //First Frame - Image only TileItemFrame logoDXFrame = new TileItemFrame(); TileItemElement logoEl = new TileItemElement(); logoEl.Image = i; //dien logo doi bong logoEl.ImageScaleMode = TileItemImageScaleMode.Stretch; logoDXFrame.Elements.Add(logoEl); logoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True; //Second Frame - Text only TileItemFrame mottoDXFrame = new TileItemFrame(); TileItemElement mottoEl = new TileItemElement(); mottoEl.Text = "<Size=+2><Color=Sienna><b>" + (dtTeam.Rows[index]["Name"]).ToString() + "</b></Color></Size>"; //dien ten doi bong mottoEl.TextAlignment = TileItemContentAlignment.MiddleCenter; mottoDXFrame.Elements.Add(mottoEl); mottoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True; //Global Tile Item Settings newTile.Frames.Add(logoDXFrame); newTile.Frames.Add(mottoDXFrame); newTile.Appearance.BackColor = System.Drawing.Color.WhiteSmoke; //newTile.Appearance.BackColor2 = System.Drawing.Color.SandyBrown; newTile.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal; newTile.Appearance.BorderColor = System.Drawing.Color.Bisque; //newTile.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True; newTile.FrameAnimationInterval = 2500; newTile.ItemSize = TileItemSize.Medium; // newTile.AppearanceItem.Pressed.BackColor = Color.Black; tileControl1.Groups.Add(new TileGroup()); tileControl1.Groups[0].Items.Add(newTile); newTile.StartAnimation(); newTile.Name = (dtTeam.Rows[index]["TeamID"]).ToString(); newTile.ItemClick += newTile_ItemClick; newTile.ItemDoubleClick += newTile_ItemDoubleClick; }
private void contentGenerate_Click(object sender, EventArgs e) { TileItem newTile = new TileItem(); //First Frame - Image only TileItemFrame logoDXFrame = new TileItemFrame(); TileItemElement logoEl = new TileItemElement(); logoEl.Image = global::WinTileItemCodeCreating.Properties.Resources.DXv2Logo_small; logoEl.ImageAlignment = TileItemContentAlignment.MiddleCenter; logoDXFrame.Elements.Add(logoEl); logoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True; //Second Frame - Text only TileItemFrame mottoDXFrame = new TileItemFrame(); TileItemElement mottoEl = new TileItemElement(); mottoEl.Text = "<Size=+2><Color=Sienna><b>Let's see what develops.</b></Color></Size>"; mottoEl.TextAlignment = TileItemContentAlignment.MiddleCenter; mottoDXFrame.Elements.Add(mottoEl); mottoDXFrame.Elements[0].AnimateTransition = DevExpress.Utils.DefaultBoolean.True; //Global Tile Item Settings newTile.Frames.Add(logoDXFrame); newTile.Frames.Add(mottoDXFrame); newTile.Appearance.BackColor = System.Drawing.Color.Bisque; newTile.Appearance.BackColor2 = System.Drawing.Color.SandyBrown; newTile.Appearance.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal; newTile.Appearance.BorderColor = System.Drawing.Color.Bisque; newTile.AllowHtmlText = DevExpress.Utils.DefaultBoolean.True; newTile.FrameAnimationInterval = 2500; newTile.IsLarge = true; tileControl1.Groups.Add(new TileGroup()); tileControl1.Groups[0].Items.Add(newTile); newTile.StartAnimation(); }