I am trying to manually draw a rectangle with text inside of a panel. I have the code to do this but for some reason nothing is being drawn on the panel. It draws just fine on the main form but when I try to draw on the panel, nothing shows up.
Any help is greatly appreciated. Thank you.
Code:
private void panel1_Paint(object sender, PaintEventArgs e)
{
Rectangle rec = new Rectangle(ITEM_PADDING, currentYPosition, (m_maxItemWidth - ITEM_PADDING), Height);
e.Graphics.DrawRectangle(blackPen, rec);
}
Any help is greatly appreciated. Thank you.
Comment