private void m_RenderMapInfoButton_Click(object sender, EventArgs e) { MapInfoProvider layer = null; try { layer = new MapInfoProvider(m_mapinfofiletext.Text); } catch (Exception ex) { MessageBox.Show(this, "Could not open file\nError: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //show map frmMap dlg = new frmMap(layer.MaxBounds, layer.CoordinateSystem, layer); dlg.ShowDialog(); }