My transparent approach now is to let UserControl Transparent and supports container functionality
Programming Challenge:How to make Picturebox1 control truly transparent.Remove the background color, set the transparency of the PNG channel as a background image function.
Code:
SetWindowLong Picturebox1.hwnd, GWL_EXSTYLE, GetWindowLong(Picturebox1.hwnd, GWL_EXSTYLE) Or WS_EX_TRANSPARENT
Set mSubclass = New clsTrickSubclass
mSubclass.Hook Me.hwnd
@Napoleon,
You can do so without regioning - by using a transparent usercontrol instead.
1. Create a UserControl. 2. Set it's ControlContainer = True and BackStyle = Transparent 3. FILL the usercontrol with a Rounded Rectangle shape. (For smoother effect,set the Shape's BorderStyle to Transparent.) 4. Set the shape's FillStyle to Solid. 5. Now use this user control as the container of your WebBrowser Cotrol.
PS. It is better idea to create a new thread (with link to the original one) rather than digging up an old one.
(Possibly CodeBank threads are only exceptions)
Reference VB.NET,When loading the form, specify the background of PictureBox1 as transparent, and then specify PictureBox1 as the parent container of PictureBox2, so that PictureBox2 can be transparent to PictureBox 1 and both transparent to the form background. VB2010 environment. The code is as follows: The left side of the screenshot is the running effect, the right side is the programming environment, I hope you will be satisfied with this effect.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PictureBox1.BackColor = Color.Transparent
PictureBox2.Parent = PictureBox1
End Sub