Prevent listview backgroundimage from scrolling with list

B

Bob Dankert

Is there any way to prevent the listview background image from scolling with
the listview contents? I would like to have an image which does not change
and does not move. This is using the 2.0 framework.

Thanks!

Bob Dankert
 
J

Jeffrey Tan[MSFT]

I will spend some time to some research in this issue, I will update you
ASAP. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi Bob,

Sorry for let you wait for so long.

Yes, we can supply a background image for ListView with LVM_SETBKIMAGE
message, which is demonstrated in the link below:
http://dotnet.mvps.org/dotnet/faqs/?id=listviewbackgroundimage&lang=en
However, this background image will go with the scrollbar scrolling.

To get the watermark effect(fixed position in the background), there is no
easy way to do this, because ListView control does not provide build-in
support for this. We have to draw the background image ourselves in a fixed
position. The article below shows this in a win32 way:
"Use a bitmap as a background image"
http://www.codeguru.com/Cpp/controls/listview/backgroundcolorandimage/articl
e.php/c983

It requires a lot of work to do the same thing in .Net winform.

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
B

Bob Dankert

Jeffrey,

Thanks for the link - it does look like a lot of work to get this effect! I
will see if I can get this implemented easily, otherwise I might find some
ways to get around this (change the image each time the control is scrolled,
capture WM_VSCROLL in WndProc) - I'm not sure how much flicker this would
produce and memory this would use. Might slow it down too much.

Thanks for looking in to this, if I have any difficulties, I will let you
know.

Bob Dankert
 
J

Jeffrey Tan[MSFT]

Yes, I also suspect this workaround may cause a lot of flicker for the
application.

Anyway, if you need further help, please feel free to feedback. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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

Top