// TODO - Need to get rid of border still. private void textBoxDescription_CustomPaint(object sender, MetroFramework.Drawing.MetroPaintEventArgs e) { //int width = ((MetroFramework.Controls.MetroTextBox)sender).Width; //int height = ((MetroFramework.Controls.MetroTextBox)sender).Height; ////e.Graphics.DrawRectangle(new System.Drawing.Pen(System.Drawing.Color.Black), new Rectangle(0, 0, width, height)); //e.Graphics.FillRectangle(new SolidBrush(Color.Green), new Rectangle(0, 0, width, height)); return; }
private void textBoxDescription_CustomPaintForeground(object sender, MetroFramework.Drawing.MetroPaintEventArgs e) { int width = ((MetroFramework.Controls.MetroTextBox)sender).Width; int height = ((MetroFramework.Controls.MetroTextBox)sender).Height; Rectangle newRect = new Rectangle(0, 0, width, height); newRect.Inflate(-10, -10); e.Graphics.FillRectangle(new SolidBrush(Color.Transparent), newRect); //return; }
//Evento de renderização do controle relacionado por abrigar os blocos private void m_MainPanel_CustomPaint(object sender, MetroFramework.Drawing.MetroPaintEventArgs e) { Pen v_DashedPen = new Pen(Color.Black, 2.0f); v_DashedPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; for (int i_Block = 0; i_Block < m_Blocks.Count; i_Block++) { m_Blocks[i_Block].draw(e.Graphics); if (m_Blocks.Count > 1 && i_Block < m_Blocks.Count - 1) { e.Graphics.DrawLine(v_DashedPen, m_Blocks[i_Block].Position, m_Blocks[i_Block + 1].Position); } } }
private void _pnlPie_CustomPaint(object sender, MetroFramework.Drawing.MetroPaintEventArgs e) { int opacity = Globals.MainForm.SettingsForm.ShowPieOpacity; // Create pen. SolidBrush red = new SolidBrush(Color.FromArgb(opacity, 0, 174, 219)); // Create rectangle for ellipse. Rectangle rect = new Rectangle(0, 0, _pnlPie.Width, _pnlPie.Height); // Create start and sweep angles. float startAngle = 0.0F; float sweepAngle = 360.0f * _fTimerPiePct; // Draw pie to screen. e.Graphics.FillPie(red, rect, startAngle, sweepAngle); }