//----------this is msinform code.When i click on symbology button symbology form get called-------------------------- Here I have used usercontrol themview1 which stores the added layers with index selectorder. private void symbology_Click(object sender, EventArgs e) { if (symbology_btn.Checked == false) { if (selectedOrder == -1) MessageBox.Show("First Select appropriate Layer"); else { Symbology symb = new Symbology(); symbology_btn.Checked = true; filename = themeview1.Items[selectedOrder].ShapeName; //storing layername in string filename symb.symblist = filename; symb.MdiParent = this; symb.Parent = winformsMap1; try { symb.Show(); } catch (ObjectDisposedException od) { MessageBox.Show("Disposed Error.."); } } } else { symbology_btn.Checked =false; } } //------------------This is code for symbology form--------------------------------------- //here i am inheriting mainform i.e. mdi form and passing shapefile name to txt_layer.text. namespace WindowsFormsApplication2 { public partial class Symbology : Form { private string symlayer; private string layer; private string layername; private string filename; private Collection file; private int index; private int countfield; ZedGraphStyle zedGraphStyle = new ZedGraphStyle(); LayerOverlay layerOverlay2 = new LayerOverlay(); public string symblist { get { return symlayer; } set { txt_layer.Text = value; } } public Symbology() { InitializeComponent(); } private void zedGraphStyle_BarGraphDrawing(object sender, ZedGraphDrawingEventArgs e) { WinformsMap winformsMap1 = (WinformsMap)this.Parent; double scale = ExtentHelper.GetScale(winformsMap1.CurrentExtent, winformsMap1.Width, GeographyUnit.DecimalDegree); // Change the size of the graph based on the scale. It will get bigger as you zoom in. int graphHeight = Convert.ToInt32(700000000 / scale); ZedGraphControl zedGraph = new ZedGraphControl(); zedGraph.Size = new Size(graphHeight, graphHeight); GraphPane myPane = zedGraph.GraphPane; for (index = 0; index < countfield; index++) { myPane.XAxis.Title.Text = list_fieldfinal.Items[index].ToString(); myPane.YAxis.Title.Text = list_fieldfinal.Items[index].ToString(); } PointPairList list = new PointPairList(); Random rand = new Random(); for (index = 0; index < countfield; index++) { try { string fields = list_fieldfinal.Items[index].ToString(); list.Add(index + 1, double.Parse(e.Feature.ColumnValues[fields])); } catch (FormatException formatexception) { //MessageBox.Show("Please Check the Datatype of attribute."); } finally { } } string name = " Bar"; BarItem myCurve = myPane.AddBar(name, list, Color.Blue); zedGraph.AxisChange(); e.Bitmap = zedGraph.GraphPane.GetImage(); } public void bargraph() { layer = txt_layer.Text; WinformsMap winformsMap1 = (WinformsMap)this.Parent; countfield = list_fieldfinal.Items.Count; if (countfield == 2) { layername = new FileInfo(layer).Name; ShapeFileFeatureLayer layerfile = new ShapeFileFeatureLayer(layername); InMemoryFeatureLayer bargraphLayer = (InMemoryFeatureLayer)winformsMap1.FindFeatureLayer(layer); bargraphLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(zedGraphStyle); bargraphLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; zedGraphStyle.ZedGraphDrawing += new EventHandler(zedGraphStyle_BarGraphDrawing); for (int count = 0; count < countfield; count++) { zedGraphStyle.RequiredColumnNames.Add(list_fieldfinal.Items[count].ToString()); } layerOverlay2.Layers.Add("BargraphsLayer", bargraphLayer); winformsMap1.Overlays.Add("BargraphOverlay", layerOverlay2); winformsMap1.Refresh(); } else MessageBox.Show("Two Items should be compulsory For Bar graph operation"); } } }