Draw on Top of Map
This snippet demonstrates how to intercept the WM_PAINT event (rather than overriding the OnPaint method, which doesn't work with the map) in order to draw custom content on top of the map using a standard GDI+ Graphics object.
' A sublcass of the map that intercepts the paint event, allowing you to draw custom details Public Class DrawMap Inherits AxMapWinGIS.AxMap Private Const WM_PAINT = &HF Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) MyBase.WndProc(m) If m.Msg = WM_PAINT Then Dim g As Graphics = Me.CreateGraphics() ' Insert your custom drawing here. Remember this will draw in screen coordinates. g.DrawString("Test", New Font("Ariel", 20), Brushes.Black, 200, 200) g.Dispose() End If End Sub End Class Public Class Form1 ' This function shows how to add the sub-class map to a form programatically. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Create a new instance of the subclass Dim MyMap As New DrawMap ' Force the new map to load on this form, or any other container control by setting the parent property MyMap.Parent = Me ' Then control the properties that you want. MyMap.Dock = DockStyle.Fill ' Then use MyMap exactly like you would the AxMap End Sub End Class