PDA

View Full Version : Turning on all pushpin Balloon sTate



Anonymous
11-17-2003, 05:22 PM
I'm trying to turn on all the pushpins balloon's that I have on my map which is about 15 or so pushpins. The code that I'm using works but only turns on two of them and not the rest. Does anybody now why this is happening? Here is the code the I'm executing;

Private Sub btnBalloonsONOFF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBalloonsONOFF.Click
Dim oPushPin As MapPoint.Pushpin

If bISBallOn = False Then
btnBalloonsONOFF.Text = "Information On"
bISBallOn = True

For Each ds In oMap.DataSets
oRecSet = ds.QueryAllRecords
oRecSet.Pushpin.BalloonState = MapPoint.GeoBalloonState.geoDisplayBalloon
Next
Else
btnBalloonsONOFF.Text = "Information Off"
bISBallOn = False

For Each ds In oMap.DataSets
oRecSet = ds.QueryAllRecords
oRecSet.Pushpin.BalloonState = MapPoint.GeoBalloonState.geoDisplayNone
Next
End If
End Sub

Bug
02-18-2004, 11:24 AM
Here's how I do it.

Public Sub MinimumDetails(ByVal Requester As frmMap)

Dim oMap As MapPoint.Map = Requester.MappointControl1.ActiveMap
Dim oDataSets As MapPoint.DataSets
Dim oDataset As MapPoint.DataSet
Dim oRS As MapPoint.Recordset

oDataSets = oMap.DataSets

For Each oDataset In oDataSets
oRS = oDataset.QueryAllRecords
oRS.MoveFirst()
Try
While Not oRS.EOF
oRS.Pushpin.BalloonState = MapPoint.GeoBalloonState.geoDisplayName
oRS.MoveNext()
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Next
End Sub
End If