tileControl 包含TileGroup
TileGroup 包含 Tile
Tile拖拽时代码 TilteControl的itemPress事件执行 或Tile的itemPress执行
Tile拖拽结束代码通过 TileControl的ItemDropped 事件执行
动态创建Tile
ti = new TileItem(); ti.ItemSize = TileItemSize.Small;//样式 小图标 var account = new TileItemElement(); account.Appearance.Normal.Font = new System.Drawing.Font("微软雅黑", 18.0f, System.Drawing.GraphicsUnit.Point); ti.Elements.Add(account); var amount = new TileItemElement(); amount.TextAlignment = TileItemContentAlignment.BottomRight; ti.Elements.Add(amount); if (File.Exists(@"img/异常警报.jpg")) { ti.BackgroundImage = Image.FromFile(@"img/异常警报.jpg"); } else ti.BackgroundImage = Properties.Resources.异常有警报; ti.BackgroundImageScaleMode = TileItemImageScaleMode.Stretch; tlGrop.Items.Add(ti);//加到组里
这种自定义控件属性太多 有时得试着去找如 我要生成的tile从左上开始显示(默认居中)
tlC.VerticalContentAlignment = DevExpress.Utils.VertAlignment.Top;
tlC.HorizontalContentAlignment = DevExpress.Utils.HorzAlignment.Near;