1

I want a webbrowser control on the background and a picturebox above it where I can draw and then it will appear above the webbrowser control. It's like I am writing on some paper which already has something written on it. I have placed a webbrowser control and a picture box above it both with same dimensions. I know similar question has been asked a lot of time on this website in different forms but none of the solutions mentioned are working for me.

  1. The solutions mentioned are usually for picturebox over picturebox not picturebox over webbrowser control. simply putting webbrowser control instead of picture does not work. Here is the code I used. The square that should have been formed was not formed.

    Public Class Form1
        Dim BMP As New Drawing.Bitmap(640, 480)
        Dim GFX As Graphics = Graphics.FromImage(BMP)
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            PictureBox1.Controls.Add(WebBrowser1)
            PictureBox1.Location = New Point(0, 0)
            PictureBox1.BackColor = Color.Transparent
            Dim blackPen As New Pen(Color.Black, 3)
            Dim point1 As New Point(100, 100)
            Dim point2 As New Point(100, 200)
            Dim point3 As New Point(200, 200)
            Dim point4 As New Point(200, 100)
            Dim curvePoints As Point() = {point1, point2, point3, point4}
            GFX.FillRectangle(Brushes.White, 0, 0, PictureBox1.Width, PictureBox1.Height)
            GFX.DrawPolygon(blackPen, curvePoints)
            PictureBox1.Image = BMP
        End Sub
    End Class
    

It did not work the other way around either, I mean drawing first and than making the picturebox transparent.

Prakhar Ganesh
  • 117
  • 2
  • 8
  • 1
    Possible duplicate of [No Transparency on Visual Basic PictureBox](http://stackoverflow.com/questions/32431300/no-transparency-on-visual-basic-picturebox) – Visual Vincent Mar 26 '17 at 15:29

0 Answers0