I'm trying to do a bit of painting on my Winform controls through the Paint event because why not. I've got this hooked up, because StackOverlfow told me it would work:
private void PaintLines(object sender, PaintEventArgs e)
{
ControlPaint.DrawBorder(e.Graphics, ClientRectangle,
Color.Gray, 1, ButtonBorderStyle.Solid,
Color.Gray, 1, ButtonBorderStyle.Solid,
Color.Gray, 1, ButtonBorderStyle.Solid,
Color.Gray, 1, ButtonBorderStyle.Solid);
}
The problem is that only works for top and left borders, not right or bottom. Here's the Designer.cs because I suspect it's a problem with how the control is set.
this.lblOffset.AutoSize = true;
this.lblOffset.Dock = System.Windows.Forms.DockStyle.Fill;
this.lblOffset.Location = new System.Drawing.Point(3, 25);
this.lblOffset.Name = "lblOffset";
this.lblOffset.Size = new System.Drawing.Size(114, 25);
this.lblOffset.TabIndex = 1;
this.lblOffset.Text = "Offset (V)";
this.lblOffset.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.lblOffset.Paint += new System.Windows.Forms.PaintEventHandler(PaintLines);
So the question is how do I get my four borders painted?