Sunday, April 25, 2010

MapInfo : Setting default drawing Style

How to set the default drawing Style for the AddMapTool ?

AddMapToolProperties addMapToolProperties = mapControl1.Tools.AddMapToolProperties as AddMapToolProperties;
CompositeStyle cs = addMapToolProperties.CompositeStyle;
LineWidth lw = new LineWidth(5, LineWidthUnit.Pixel);
SimpleLineStyle ls = new SimpleLineStyle(lw, 2, Color.Blue, false);
addMapToolProperties.CompositeStyle.LineStyle = ls;

You create the AddMapToolProperties and change the CompositeStyle according to what you want and then use this addMapToolProperties when creating your AddMapTool.

No comments: