private void ShowHistogramToolStripMenuItemClick(object sender, EventArgs e) { var name = ((TabPage)maintabcontrol.Tag).Text; var index = int.Parse(name.Substring(Calculations.Imageimage.Length)); var hg = new histogram(this, index); hg.ShowDialog(); }