Guys, I know this will be a simple answer, but I cannot figure it out. I have a C # Winform application that I am trying to create. I am trying to draw a white line 60 pixels above the bottom of the form. I am using this code:private void MainForm_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawLine(Pens.White, 10, this.Height-60, 505, this.Height-60);
}
Simple enough, but not a single line is drawn. After some debugging, I found out that she was drawing a line, but she was pushing it outside of my form. If I changed -60 to -175, then I can see it at the bottom of my form. This will solve my problem, with the exception of changing my height of the form, the line approaches and approaches the lower part of my form, until, in the end, it will not be again. What am I doing wrong? Am I using the wrong graphic block? Or is there a more complicated calculation that I need to do to determine 60 pixels from the bottom of my form?
source
share