コード例 #1
0
ファイル: FolderNavigator.cs プロジェクト: hl10502/XenCenter
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaint(e);
     if (folderListItem != null)
     {
         folderListItem.DrawSelf(e.Graphics, new Rectangle(0, 2, Width, Height), false);
     }
 }
コード例 #2
0
 protected override void OnPaint(PaintEventArgs pevent)
 {
     base.OnPaint(pevent);
     if (folderListItem != null)
     {
         Rectangle r = pevent.ClipRectangle;
         r.Location = new Point(6, 4);
         r.Width   -= 21;
         r.Height  -= 6;
         folderListItem.DrawSelf(pevent.Graphics, r, false);
     }
 }
コード例 #3
0
        protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex,
                                      DataGridViewElementStates cellState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle,
                                      DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
        {
            using (SolidBrush cellBackground = new SolidBrush(Selected ? cellStyle.SelectionBackColor : cellStyle.BackColor))
            {
                graphics.FillRectangle(cellBackground, cellBounds);
            }

            Rectangle bounds = cellBounds;

            bounds.Offset(cellStyle.Padding.Left, cellStyle.Padding.Top);
            bounds.Width            -= cellStyle.Padding.Horizontal;
            bounds.Height           -= cellStyle.Padding.Vertical;
            folderListItem.ForeColor = Selected ? cellStyle.SelectionForeColor : cellStyle.ForeColor;
            folderListItem.DrawSelf(graphics, bounds, false);
        }