I am sure I am missing something very simple here. I am using integrated mapping in VB. I have a form that has two picture boxes (Map1 & Legend1) I can create the map without a problem, however try as I might I cannot create a legend to appear in the second picture box. If I try this approach:
goMI.Do "Set Application Window " & frmMap.hWnd goMI.Do "Set Next Document Parent " & frmMap.Map1.hWnd & " Style 1" goMI.Do "Map From States, Counties,Townships, Hydro, Land, OCEAN" glMapWinID = Val(goMI.Eval("WindowID(0)")) Code to create the thematic map goMI.Do "Set Window Legend Parent " & frmMap.Legend1.hWnd goMI.Do "Create Legend" glLegendWinID = Val(goMI.Eval("WindowID(0)")) sLegendStmt = "Set Legend Window " & glLegendWinID sLegendStmt = sLegendStmt & " Layer 1 Display On Shades Off Symbols On Lines Off Count Off " sLegendStmt = sLegendStmt & "Title " & Chr$(34) & " Simulated Yield " & Chr$(34) & " Font (""Arial"",1,10,0) " sLegendStmt = sLegendStmt & "Ascending On Ranges Font (""Arial"",0,9,0) " sLegendStmt = sLegendStmt & "Auto Display Off ," sLegendStmt = sLegendStmt & Chr$(34) & "< 25" & Chr$(34) & " Display On ," sLegendStmt = sLegendStmt & "Auto Display On ," sLegendStmt = sLegendStmt & "Auto Display On ," sLegendStmt = sLegendStmt & "Auto Display On ," sLegendStmt = sLegendStmt & "Auto Display On ," sLegendStmt = sLegendStmt & "Auto Display On ," sLegendStmt = sLegendStmt & "Auto Display On ," sLegendStmt = sLegendStmt & "Auto Display On ," sLegendStmt = sLegendStmt & Chr$(34) & "200 +" & Chr$(34) & " Display On " goMapInfo.Do sLegendStmt When it processes the legend code I get a run time error: "Error: expecting Mapper Window" on the last line of the code above. If I try substituting goMI.Do "Set Next Document Parent " & frmMap.Legend1.hWnd & " Style 1" for goMI.Do "Set Window Legend Parent " & frmMap.Legend1.hWnd I get the same error. How do I create a legend in a second picture box on the same form that has the map? Tim Fast Pioneer Hi-Bred International _______________________________________________________________________ List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, send e-mail to [EMAIL PROTECTED] and put "unsubscribe MapInfo-L" in the message body.