Click here to Skip to main content
Licence CPOL
First Posted 5 Aug 2009
Views 22,301
Downloads 543
Bookmarked 27 times

ListView Watermark in VB.NET

By | 8 Aug 2009 | Article
Code to add a watermark to a ListView using the LVBKIF_TYPE_WATERMARK flag.

lvwBackground1

Windows Vista Screenshot

Windows XP Screenshot

Introduction

This code uses the LVBKIF_TYPE_WATERMARK flag of LVBKIMAGE to put a watermark in the lower right corner of a ListView control.

Using the code

The zip file above includes a class that inherits the ListView. Add the class to your solution, and build the solution. In the control's toolbox, you'll see the cListView added. Drag one onto the form and set its WatermarkImage property to the desired image you want. Also, set the WatermarkAlpha property to the desired translucency. It will support any image file that VB.NET can open. It will automatically convert the image to the needed bitmap.

Points of interest

It took me about 4+ months to figure out how to make the flag work. All I could find were C++ demonstrations for the flag. Finally I came through.

"I strived for a goal, and I succeeded". In other words I tried and tried again.

History

I don't plan on any updates, but you will be the first to know if I do.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

clwprogrammer



United States United States

Member

Self Taught. I started with vba in excel writing a few templates for my daddy's job. I then went from there to Visual Basic 6. Just played around with it a lot. I saw something I wanted to try to reproduce, and I worked at it until it worked(mostly). Now I am into vb.net. I am currently working on a few different things at the moment, but my time is limited, because I have to work for a living.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionListviewitem backcolor ignored... PinmemberMCS_Erik0:18 14 Nov '11  
AnswerRe: Listviewitem backcolor ignored... Pinmemberclwprogrammer21:28 14 Nov '11  
GeneralMy vote of 5 Pinmemberswdev.bali18:27 6 Nov '11  
QuestionOn Windows 2003 Pinmemberjuansossa3:28 29 Oct '09  
AnswerRe: On Windows 2003 Pinmemberclwprogrammer10:41 29 Oct '09  
QuestionSimilar, but for Textboxes? PinmemberJohnny J.1:13 8 Oct '09  
GeneralSome Information Pinmemberclwprogrammer10:40 20 Sep '09  
General[My vote of 2] good find PinmemberDonsw16:24 12 Sep '09  
Generalwow ... PinmemberFidoDildo1:03 31 Aug '09  
GeneralRe: wow ... Pinmemberclwprogrammer8:56 31 Aug '09  
GeneralRe: wow ... PinmemberFidoDildo20:24 31 Aug '09  
GeneralRe: wow ... Pinmemberclwprogrammer6:17 1 Sep '09  
GeneralA change in the GetBMP Function in the extended control's code. Pinmemberclwprogrammer23:00 14 Aug '09  
GeneralAbout the BMP.Dispose Pinmemberclwprogrammer9:18 6 Aug '09  
Generalbmp.dispose not called in GetMBP Pinmemberd_camillo19:03 5 Aug '09  
GeneralRe: bmp.dispose not called in GetMBP Pinmembertgrt2:40 9 Aug '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 8 Aug 2009
Article Copyright 2009 by clwprogrammer
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid