void _view_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) { if (hotRow != e.RowHandle && e.RowHandle != _view.FocusedRowHandle) { return; } GridCellInfo CellInfo = e.Cell as GridCellInfo; SimpleButton button = new SimpleButton(); _view.GridControl.FindForm().Controls.Add(button); button.Bounds = CellInfo.RowInfo.Bounds; Bitmap bm = new Bitmap(button.Width, button.Height); button.DrawToBitmap(bm, new Rectangle(0, 0, bm.Width, bm.Height)); Rectangle rec = Rectangle.Intersect(CellInfo.RowInfo.Bounds, CellInfo.CellValueRect); rec.Offset(-CellInfo.RowInfo.Bounds.X, -CellInfo.RowInfo.Bounds.Y); e.Cache.Paint.DrawImage(e.Cache.Graphics, bm, CellInfo.Bounds); _view.GridControl.FindForm().Controls.Remove(button); }
void DrawBackGround(TreeListNode node, CustomDrawEventArgs e) { if (hotNode != node && !node.Focused) { return; } SimpleButton backButton = new SimpleButton(); Tree.FindForm().Controls.Add(backButton); RowInfo ri = Tree.ViewInfo.RowsInfo[node]; backButton.Bounds = ri.Bounds; Bitmap bm = new Bitmap(backButton.Width, backButton.Height); backButton.DrawToBitmap(bm, new Rectangle(0, 0, bm.Width, bm.Height)); Rectangle rec = Rectangle.Intersect(ri.Bounds, e.Bounds); rec.Offset(-ri.Bounds.X, -ri.Bounds.Y); e.Graphics.DrawImage(bm, e.Bounds, rec, GraphicsUnit.Pixel); Tree.FindForm().Controls.Remove(backButton); }
void DrawBackGround(TreeListNode node, CustomDrawEventArgs e) { TreeListNode hotNode = null; if (hotNode != node && !node.Focused) return; SimpleButton button = new SimpleButton(); this.Controls.Add(button); RowInfo ri = treeList1.ViewInfo.RowsInfo[node]; button.Bounds = ri.Bounds; Bitmap bm = new Bitmap(button.Width, button.Height); button.DrawToBitmap(bm, new Rectangle(0, 0, bm.Width, bm.Height)); Rectangle rec = Rectangle.Intersect(ri.Bounds, e.Bounds); rec.Offset(-ri.Bounds.X, -ri.Bounds.Y); e.Graphics.DrawImage(bm, e.Bounds, rec, GraphicsUnit.Pixel); //e.Handled = true; }