From: JP Bless on
Tested the code... worked OK with listbox. But I can't (so far) get it to
work with listview. It did not throw any error yet the size or background
color of the listview did not change. If any one figures how to make this
code work with a listview... or if you have another code that could make a
listview transparent please be kind enough and help.

Thanks all

"Mike Williams" <mikea(a)whiskyandCoke.com> wrote in message
news:Of2NYCi4HHA.5740(a)TK2MSFTNGP04.phx.gbl...
> "DanS" <t.h.i.s.n.t.h.a.t(a)a.d.e.l.p.h.i.a.n.e.t> wrote in message
> news:Xns9990E2F311D41thisnthatadelphianet(a)216.196.97.142...
>
> . . . another thing I've just thought of is the possibility that your
> system is having problems creating a full screen Autoredraw image (which
> is what an Autoredraw Form requires), or that it's having problems
> creating the two Autoredraw Picture Boxes after it has done so. I've come
> across such things occasionally on some systems with low available memory
> or poor graphics capabilities. It isn't very likely though, because if
> that was the case the Autoredraw failure would be notified to you as a VB
> runtime error message. It might be worth setting your systems display
> resolution to a lower setting though, just temporarily for test pusposes.
> Try running it at 800 x 600 and see what happens. If the screen resolution
> or Autoredraw turns out to be the problem then we'll be able to find a way
> of tackling it, although I must admit it's not the likely cause of your
> problem.
>
> Mike
>
>
>
>


From: Schmidt on

"JP Bless" <jp3BlessNoSpam(a)hotmail.com> schrieb im Newsbeitrag
news:etLW3kl4HHA.3684(a)TK2MSFTNGP02.phx.gbl...

> Tested the code... worked OK with listbox.
> But I can't (so far) get it to work with listview.
Do you need the listview in Report-Mode (so that it
looks more like a grid)?

Then you should look at the sgrid-implementation on
vbaccelerator - that allows to set a background-picture
into the control (simply place the Form-Background-Pic
into it - with the appropriate offsets).

http://www.vbaccelerator.com/home/vb/code/controls/S_Grid_2/S_Grid_2/article.asp

Olaf


From: Mike Williams on
"Norm" <NormF4(a)newsgroups.nospam> wrote in message
news:Ov85dal4HHA.3900(a)TK2MSFTNGP02.phx.gbl...

> Mike, Very nice effect. Is it possible to do this on a form
> that is not full screen?

Yes. You can use it on any size of Form.

> I only tried once to set the form size back to what it was
> before making transparent, but get a message that cannot
> set the size on a form that is maximized.

That's probably because you've attempted to set the Width or Height
property, which is not permitted while the Form is maximized. The solution
is to use Me.WindowState = vbNormal immediately after the Me.PaintPicture
line. The picture will still be drawn at a scale that fits the fully
maximized Form, but the Form will then immediately return to its normal size
and the appropriate part of the picture will be visible as the Form is
resized by the user.

Alternatively, if you want the picture to be scaled so that it exactly fits
a smaller size Form, and if you intend to keep the Form at its small size,
then simply omit the Me.WindowState = vbMaximized line. One other thing you
might want to do is to draw the picture at such a size that it completely
fits the Form whatever size it is, and redraws itself to the new size every
time the user changes the size of the Form, but you'd need to add a bit of
extra code to do that and you would need to ensure that you changed the
BackgroundBrush accordingly and caused it to be properly redrawn at each
change in size. And, of course, you don't need to use the entire Form for
the background image of the ListBox. There are all sorts of possibilities,
depending on exactly what you want to do.

Mike


From: Mike Williams on
"Norm" <NormF4(a)newsgroups.nospam> wrote in message
news:%23jVqtIl4HHA.748(a)TK2MSFTNGP04.phx.gbl...

> I wonder if Lance and Dan are using a picture with part white
> background? I thought at first it was not working here also, but
> it was on a white part of the background and just did not look
> transparent. Moving the list box to the lower part of the form showed that
> it was transparent.

Actually Dan is using a picture in which the lack of transparency would be
obvious (see the link he posted). Something on Dan's system is causing the
code to fail to work, and it is possible that doing the job in a slightly
different way in order to reduce the memory overhead (which at the moment is
a bit wasteful in the testbed code) would solve his problem, but it isn't
worth tackling that job just yet until Dan responds to the questions that
were posted so that we can get a better idea of exactly what it is on his
system that is causing the problem.

Mike


From: DanS on
Subject: Re: Make ListView transparent
Newsgroups: Free Post Usenet:microsoft.public.vb.general.discussion
To: Mike Williams <mikea(a)whiskyandCoke.com>

"Mike Williams" <mikea(a)whiskyandCoke.com> wrote in
news:Omb2w8h4HHA.1208(a)TK2MSFTNGP03.phx.gbl:

> "DanS" <t.h.i.s.n.t.h.a.t(a)a.d.e.l.p.h.i.a.n.e.t> wrote in message
> news:Xns9990E2F311D41thisnthatadelphianet(a)216.196.97.142...
>
>> Well I tried it again. New project, added 1 listbox, 2 picture
>> boxes, changed the name of the image file in the code to load
>> kitty.jpg instead of what was there....no transparency.
>> A screenshots here, it looks just like a standard listbox.
>
> Perhaps your system is having trouble with the AlphaBlend function,
> which is what effectively sets the opacity. There is only one call to
> Alphablend, and that is the call near the bottom of the Form's Load
> event. What happens if you comment out that line, so that it does not
> execute? You should get full transparency.

Still no transparency.

>
> Another possibility, which seems quite likely looking at your
> screenshot, is that the pattern brush is not being created for some
> reason on your system.
<SNIP>
> The first thing to do (just as a
> test) is to make the size of your ListBoxes much smaller. Does that
> change anything?

Smaller listbox makes no difference.

>
> Also, try temporarily placing an additional line in the
> SubClassListBox function in the module code to display the brush
> handle in the Form's caption.
<SNIP>
> Form1.Caption = Hex(BackgroundBrush) ' <<< this new line added

Still no dice. I get a return value from this, not 0, so I'm assuming that
it is being created properly.

> There's got to be a reason why this code works on some systems and not
> others, and I'm sure we'll pin it down sooner or later :-)

In regards to the graphics card....it's an nVidia FX5200. I'd have a hard
time believing that the GPU could be an issue. I've used layered windows
and made them translucent. (While it may be a little slow) it was still
able to display 15 translucent windows on top of each other.

I lowered the resolution from 1400x1050x32bpp to 1024x768x16bpp...no
difference. For a stab-in-the-dark I also turned off ClearType.

In another test, I rem'd out the line that makes Picture2 not visible so
you can see what is happening. The AlphaBlend call is successful on
Picture2. I have changed the alpha level which results in different blends,
so that is not an issue.

OK, I'm back with some more experimenting (was testing for an hour)......

The deal is, for some reason in the IDE, I never see the WM_CTLCOLORLISTBOX
message sent to the LB parent, Picture1. Spy++ never sees this
notification. I was thinking maybe it had something to do with my shell not
being explorer, so i decided to try it on the wife's PC. VS is not
installed there, so I compiled and ran it there, and it worked fine.

Hmmm. Run the compiled one on this PC and it works as well. Odd that that
msg wouldn't be sent in the IDE.

Sorry for all the trouble guys.

Regards,

DanS