private void pageBody_Paint(object sender, PaintEventArgs e) { if (SelectedPage == null) { return; } using (var b = new SolidBrush(Color.FromArgb(70, LayoutSetting.GetBackColorHover(LayoutSetting.Theme)))) { if (_startCell != null && _endCell != null) { foreach (var cell in _cells) { if (!cell.IsInRange(_startCell, _endCell)) { continue; } e.Graphics.FillRectangle(b, cell.X, cell.Y, cell.Width, cell.Height); } } else { foreach (var cell in _cells) { if (!cell.IsSelected) { continue; } e.Graphics.FillRectangle(b, cell.X, cell.Y, cell.Width, cell.Height); } } } }
protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); if (LayoutSetting.IsEditMode) { return; } BackColor = LayoutSetting.GetBackColorHover(LayoutSetting.Theme); ForeColor = LayoutSetting.GetForeColorHover(LayoutSetting.Theme); }
protected override void OnPaint(PaintEventArgs e) { using (var backBrush = new SolidBrush(LayoutSetting.GetBackColorHover(LayoutSetting.Theme))) using (var innerBrush = new SolidBrush(LayoutSetting.GetBackColorCommon(LayoutSetting.Theme))) { var rec = e.ClipRectangle; e.Graphics.FillRectangle(backBrush, rec); rec.Width = (int)(rec.Width * ((double)Value / Maximum)) - 4; rec.Height = rec.Height - 4; e.Graphics.FillRectangle(innerBrush, 2, 2, rec.Width, rec.Height); } }
protected override void OnDrawItem(DrawListViewItemEventArgs e) { if (e.Item.Focused) { e.Item.BackColor = LayoutSetting.GetBackColorHover(LayoutSetting.Theme); e.Item.ForeColor = LayoutSetting.GetForeColorHover(LayoutSetting.Theme); } else { e.Item.BackColor = LayoutSetting.GetBackColorCommon(LayoutSetting.Theme); e.Item.ForeColor = LayoutSetting.GetForeColorCommon(LayoutSetting.Theme); } e.DrawBackground(); e.DrawText(TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter); }
protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); if (Runtime.DesignMode) { return; } _doccomment.Resize += delegate(object sender, EventArgs ex) { //var renderer = ToolStripRenderer as ThemeToolStripRenderer; //LineColor = renderer.ColorTable.ToolStripGradientBegin; //HelpBackColor = renderer.ColorTable.ToolStripGradientBegin; LineColor = LayoutSetting.GetBackColorCommon(LayoutSetting.Theme); HelpBackColor = LayoutSetting.GetBackColorCommon(LayoutSetting.Theme); CategoryForeColor = LayoutSetting.GetForeColorCommon(LayoutSetting.Theme); SelectedItemWithFocusBackColor = LayoutSetting.GetBackColorHover(LayoutSetting.Theme); SelectedItemWithFocusForeColor = LayoutSetting.GetForeColorHover(LayoutSetting.Theme); }; _doccomment.Height++; _doccomment.Height--; }
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (BackgroundImage != null) { ImageAnimator.UpdateFrames(BackgroundImage); e.Graphics.DrawImage(BackgroundImage, 0, 0, Width, Height); } // 에디트 모드에서 이미지가 없을시 파란색 표기 else if (LayoutSetting.IsEditMode) { using (var b = new SolidBrush(Color.FromArgb(50, Color.Blue))) { e.Graphics.FillRectangle(b, new Rectangle(0, 0, Width, Height)); } } // Text 표기 if (!string.IsNullOrWhiteSpace(TextContent)) { var color = LayoutSetting.GetForeColorCommon(LayoutSetting.Theme); using (var b = new SolidBrush(color)) { e.Graphics.DrawString(TextContent, TextFont, b, ClientRectangle, GetStringFormat()); } } // 마우스 오버 표기 if (_isMouseOver) { var color = Color.FromArgb(50, LayoutSetting.GetBackColorHover(LayoutSetting.Theme)); using (var b = new SolidBrush(color)) { e.Graphics.FillRectangle(b, 0, 0, Width, Height); } } // 에디트 모드에서 Resize, 선택시 빨간색 표기 if (LayoutSetting.IsEditMode) { using (var b = new SolidBrush(Color.Red)) using (var p = new Pen(Color.Red, 2)) { var bottom = ResizeRec; Point[] locs = new Point[] { new Point(bottom.X, bottom.Y + bottom.Height), new Point(bottom.X + bottom.Width, bottom.Y), new Point(bottom.X + bottom.Width, bottom.Y + bottom.Height) }; e.Graphics.FillPolygon(b, locs); e.Graphics.FillRectangle(b, MoveRec); e.Graphics.DrawRectangle(p, new Rectangle(0, 0, Width, Height)); } if (IsSelected) { using (var b = new SolidBrush(Color.FromArgb(100, Color.Red))) { e.Graphics.FillRectangle(b, 0, 0, Width, Height); } } } }