private void DrawRedArrowIndicator(Graphics g) { // There is always a small black rectangle at the lower right-corner. Drawing // over the previously painted BackgroundImage resolves this issue. //GridRangeInfo rows = GetRangeOfColumnHeaderSection(); int rowIndex = grid.Model.RowCount > 1 ? 2 : 0; //rows.Top; Bitmap leftBitmap = IconDrawingSupport.RedLeftBitmap; Bitmap rightBitmap = IconDrawingSupport.RedRightBitmap; Size size = new Size(leftBitmap.Width * 2 + colWidthOnRedArrowCreate - 1, rowHeightOnRedArrowCreate); Rectangle bounds = new Rectangle(Point.Empty, size); Color backColor = Color.Red; if (!DragFieldMouseControllerBase.SupportsTransparentForm()) { GridStyleInfo style = grid.Model[rowIndex, 0]; backColor = Color.FromArgb(255, style.Interior.BackColor); } try { g.FillRectangle(new SolidBrush(backColor), new Rectangle(Point.Empty, size)); g.DrawImageUnscaled(leftBitmap, size.Width - leftBitmap.Width, 0); g.DrawImageUnscaled(rightBitmap, 0, 0); } finally { } }
internal void OpenRedArrowIndicator() { if (!ShouldOpenArrow(false)) { return; } redArrowOpend = true; Bitmap bm = CreateRedArrowIndicatorBitmap(); redArrowIndicatorDragHelper = new DragFieldHelper(); redArrowIndicatorDragHelper.StartDrag(bm, hiddenPoint, DragDropEffects.Move); // There is always a small black rectangle at the lower right-corner. Drawing // over the previously painted BackgroundImage resolves this issue. redArrowIndicatorDragHelper.DragWindow.Paint += new PaintEventHandler(DragWindow_Paint); if (!DragFieldMouseControllerBase.SupportsTransparentForm()) { //GridRangeInfo rows = GetRangeOfColumnHeaderSection(); int rowIndex = grid.Model.RowCount > 1 ? 2 : 0;//rows.Top; GridStyleInfo style = grid.Model[rowIndex, 0]; Color backColor = Color.FromArgb(255, style.Interior.BackColor); redArrowIndicatorDragHelper.DragWindow.BackColor = backColor; } }