How to draw list and image correctly in .net?

protected override void OnPaint(PaintEventArgs e)
{
    e.Graphics.DrawImage(render, 400, 400);
}

      

This is the OnPaint class of the Form1 class. The form has a list. The problem is that the render is partially visible when the form is resized. Is the listbox clipping it in some way? The list and bitmap do not overlap.

I've tried the following:

  • Call base.OnPaint (e); before and after DrawImage () ;.
  • Set the form to doublebuffer, userpaint, color everything in WM conf, etc.
  • Try to update () and Update () from the list with every combination I encountered, before and after DrawImage ()
0


source to share


1 answer


Yes, ListBox has its own window handle and Paint event. You cannot paint over LB. You also would not want to generally hide all information provided in LB. Explain why you are trying to do this.



+1


source







All Articles