Screen refresh question

  • Thread starter Thread starter J L
  • Start date Start date
J

J L

I am using

SendMessage(me.Handle, WM_SETREDRAW, False, 0)

to prevent my form form displaying during my update of a listview.
During the update I possibly change the size of both the listview and
the form containing it.

My problem is that if the new form is larger than the old one, all is
fine. But if it is smaller than the old one, the image of the old one
remains outside the bounds of the new form.

Does that make sense and how can I eliminate this behavior. I use
me.Refresh after I turn the redraw back on.

TIA,
John
 
You shouldn't be using the sendmessage at all. The listview has two
methods: BeginUpdate and EndUpdate, which do this for you.
 
Hi Robin,
Thanks for the reply but Begin and EndUpdate wont do the trick for me.
I am not only updating the listview but also resizing the form and
moving buttons around. So I do need to prevent the form from redrawing
duing all of this. The problem is if the form gets smaller, then the
old excess is still visible.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top