GPS Location into map

Jul 10, 2014 at 8:23 AM
hi again!

I am trying to project the GPS location into a map ( paint a red dot at the latitude and longitude taken from 2 text boxes)
after searching the discussions i found a threat with the same object and the code ginen there was this one:
Private Sub map_Paint(sender As Object, e As PaintEventArgs)
            Map1.ResetBuffer()
            Dim g As Graphics
            Dim a As Pen = New Pen(Color.Red, 10)
            Dim ptGPSinPixels As Point = Map1.ProjToPixel(New DotSpatial.Topology.Coordinate(TextBoxlat.Text, TextBoxlong.Text))
            g.DrawEllipse(a, New Rectangle(ptGPSinPixels.X, ptGPSinPixels.Y, 20, 20))
            If (Map1.ViewExtents.MaxX < TextBoxlat.Text And Map1.ViewExtents.MinX > TextBoxlat.Text And Map1.ViewExtents.MaxY < TextBoxlong.Text And Map1.ViewExtents.MinY > TextBoxlong.Text) Then
                Map1.ViewExtents.SetCenter(TextBoxlat.Text, TextBoxlong.Text, Map1.ViewExtents.Width, Map1.ViewExtents.Height)
            End If
    End Sub
My problem is that i want this event to be triggered after i click a button (or check a check box)
i tryied to put a boolean inside and make him true in the buttonclick but nothing happened. and in general i think that there is a problem I can understand because even if i let my map_paint class as it is above and i load a new map in the map1 object, when i insert 2 values (latitude and longitude) nothing happens.
please Help me :(