//Adds a scale bar element to the layout and if there is already a map on the form we link it to the first one private void _btnScaleBar_Click(object sender, EventArgs e) { LayoutScaleBar lsb = _layoutControl.CreateScaleBarElement() as LayoutScaleBar; List <LayoutElement> mapElements = _layoutControl.LayoutElements.FindAll(delegate(LayoutElement o) { return(o is LayoutMap); }); if (mapElements.Count > 0) { lsb.Map = mapElements[0] as LayoutMap; } lsb.LayoutControl = _layoutControl; _layoutControl.AddElementWithMouse(lsb); }
// Adds a scale bar element to the layout and if there is already a map on the form we link it to the first one private void BtnScaleBarClick(object sender, EventArgs e) { _layoutControl.AddElementWithMouse(_layoutControl.CreateScaleBarElement()); }