Quote Originally Posted by Niya View Post
It is possible to host WPF Controls in a WinForms application. So you could create the ListBox in WPF and import it into a WinForms project.
The WPF listbox can't easily be activated from the Form. It can be done, and it wouldn't take thousands of lines of new code, but you do need a basic knowledge of XAML and WPF as well as the possibilities and limitations of the WindowsFormsHost and the ElementHost. It would be simple enough to just pass snapshots of the ListBox and the overlay image between Forms and WPF, but it's unecessary. A good old Forms PictureBox would be just as good for this purpose.

I agree with paul4ije that the PictureBox is the place to combine the images. Just line up the bounds of the PictureBox bounds with the ListBox, take a snapshot of the ListBox using DrawToBitMap and put the set it as the PictureBox.BackgroundImage, and set the transparent 'cancelado' as the PictureBox.Image. In other words, cancelado in front. It automatically creates the dark red areas where tranparent red overlaps the black letters. You can add or remove the cancelado just by showing or hiding the picturebox as required.

But there's an important question: is your cancelado image really transparent? If you just grab the cancelado image from the screen, it will be opaque - despite the letters being light pink on a white background. That's the same mistake as I made in post #9 above.

Spybot, I hope your 'cancellado' png image is actually transparent. If its not, I can help you make a transparent version from scratch.

There's one drawback about putting a transparent PictureBox in front of the ListBox. What you see is really a snapshot, not the ListBox itself. So if you need to scroll or change the items you have to hide the PictureBox first. You could trigger that from a MouseDown event, for example.

BB