Transparent controls on map

Topics: Windows Forms
Dec 16, 2011 at 4:34 PM

I'm not sure if I'm missing something but if I create a windows form control (ie Button, Label) on top of the map and set the controls background color to transparent, it will show the background color of the form instead of the map which negates the point of having a transparent background. Is there a way to get the map to show up instead?

Dec 16, 2011 at 7:04 PM


Dec 17, 2011 at 2:17 PM

Hello TrogdorJack,


a possible solution is


to inherit the gmap Control


 Public Delegate Sub GraphicEnter()
    Public Event OnGraphicEnter As GraphicEnter

Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)

        e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(120, Color.Red)), 0, 0, 10, 10)

 End Sub

Protected Overrides Sub OnMouseMove(ByVal e As System.Windows.Forms.MouseEventArgs)
        If e.X > 0 And e.X < 10 And e.Y > 0 And e.Y < 10 Then
            'Mouse is over red graphic rectangle
            RaiseEvent OnGraphicEnter()
        End If
End Sub

And in main Form:

        AddHandler Me.MainMap.OnGraphicEnter, AddressOf Me.MainMap_OnGraphic


    Private Sub MainMap_OnGraphic()
         'Do some things
    End Sub

Code is not the best solution, but could be a way..code is tested and works.

bye EDE




Dec 19, 2011 at 7:42 PM


I'm not sure that would do anything to help me but it did point me in the right direction so thank you.


The problem isn't with the GMap control and if I had taken a little bit longer to think things through I would have realized that :-p


I eventually found my answer here...for anyone else who wandered in here with a similar problem