Global Navigation Bar

MapInfo Products Knowledge Base


Product: MapX
Version: 4.0
Platform: All Win32 Platforms
Category: Layers

Summary:
Change "INFO TIPS" field in MapX.

Question:
How can the field used for the Info tip be changed to a different field in MapX?

Here is a sample project using the "States.TAB". How can the code be altered so that the State Abbreviation or FIPS_Code field is used for the Info tip?

tooltips.vbwfrmSEN.frxtooltips.vbpfrmSEN.frm

Answer:
To change the field used to display the Info top, set the Layer.LabelProperties.Dataset and Layer.LabelProperties.DataField to the field desired to be used for the Info tip.

'Start Code
Private Sub Form_Load()
Dim ds As Dataset

'Add the layer
Map1.Layers.RemoveAll
Map1.Layers.Add App.Path & "\mytab.tab"

'make the map look nice for the sample data
Map1.DisplayCoordSys = Map1.NumericCoordSys
Map1.Title.Visible = False
Map1.Bounds = Map1.Layers.Item("mytab").Bounds
Map1.Zoom = Map1.Zoom * 2

'Add the dataset and the label column for the tooltips
Map1.InfotipSupport = False
Set ds = Map1.Datasets.Add(miDataSetLayer, Map1.Layers.Item("mytab"))
Set Map1.Layers.Item("mytab").LabelProperties.Dataset = ds
Set Map1.Layers.Item("mytab").LabelProperties.DataField = ds.Fields.Item(3)
Map1.InfotipSupport = True
End Sub

'End code

tooltip.zip

Last Modified: 08/22/2001 07:07:15 AM
Global Navigation Bar