Will VB 2004 fix control transparency issues?

  • Thread starter Thread starter Noozer
  • Start date Start date
N

Noozer

Does anyone know if we will be able to put transparent backgrounds on
UserControls in VB 2004?
 
Hi,

Add this to the new procedure of your usercontrol to make it support
transparent background.
Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)

Ken

-------------------------
 
No it can't..

Make a UserControl with a transparent background and a round object. Now add
that control to a form overtop of an already existing control. The
UserControl will make a rectangle covering the control beneath it.

Give it a try!
 
Hi,


A control with a transparent background will take the color of its
parent. Make sure you set the transparent background controls parent to the
control you want to see. The controls parent is the form by default.

Ken
------------------
 
If you want to see/interact with the control beneath the usercontrol, then
make the usercontrol shaped, rather than transparent, by setting its region.
 
.....and as I've stated before... The image is loaded dynamically so there is
no way to know what shape to make the region.

"Mick Doherty"
 
Thanks!

I didn't know this, but it still doesn't help if the control spans across
two objects.

All I want to know is if Microsoft is going to fix this bug in VB2004 or
not. (Yes, it's a bug)
 
whether the image is loaded dynamically or at design time makes no
difference. If it was going to look right on a transparent background then
it quite obviously has transparent pixels. Use the OnPaint() subroutine to
create a region from the non transparent pixels of the image and apply it to
the usercontrol.
 
"Mick Doherty"
whether the image is loaded dynamically or at design time makes no
difference. If it was going to look right on a transparent background then
it quite obviously has transparent pixels. Use the OnPaint() subroutine to
create a region from the non transparent pixels of the image and apply it to
the usercontrol.

Why can't I just set a transparency mask colour the same way I did in VB6?
 
You are not using VB6.

I would suspect that the thinking was, if the developer/user wishes to see
objects beneath their custom control then they will want to interact with
those objects, so rather than have to pass messages to the objects beneath
they will create shaped controls in order that the other control can receive
the messages directly, thus saving valuable resources and helping to fix one
of the major complaints about VB(VB apps are too slow).

Why do you want a control that is Transparent rather than shaped?
If you just want to be able to set a MaskColor then add this property to
your usercontrol and use that color to remove from the region instead of
Color.Transparent.
 
Back
Top