CREATE FORM CHILDREN INTEGRATE NEW axMapWinGIS

Good afternoon, I need some help, please, I created a MDIParent.cs form and I can create the amount of children form I need, how do I integrate the axMapWinGis component along with a new form that will be created. axMapWinGIS component?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MapWinGIS;
using AxMapWinGIS;

namespace Git
{
public partial class Form4 : Form
{
private int childFormNumber = 0;

    public Form4()
    {
        InitializeComponent();
    }

    private void ShowNewForm(object sender, EventArgs e)
    {
        Form childForm = new Form();
        childForm.MdiParent = this;
        childForm.Text = "Janela " + childFormNumber++;
        childForm.Show();
        /// create new axmapwingis?
    }

    private void OpenFile(object sender, EventArgs e)
    {
        OpenFileDialog openFileDialog = new OpenFileDialog();
        openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
        openFileDialog.Filter = "Arquivos de texto (*.txt)|*.txt|Todos os arquivos (*.*)|*.*";
        if (openFileDialog.ShowDialog(this) == DialogResult.OK)
        {
            string FileName = openFileDialog.FileName;
        }
    }

    private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
    {
        SaveFileDialog saveFileDialog = new SaveFileDialog();
        saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
        saveFileDialog.Filter = "Arquivos de texto (*.txt)|*.txt|Todos os arquivos (*.*)|*.*";
        if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
        {
            string FileName = saveFileDialog.FileName;
        }
    }

    private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
    {
        this.Close();
    }

    private void CutToolStripMenuItem_Click(object sender, EventArgs e)
    {
    }

    private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
    {
    }

    private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
    {
    }

    private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)
    {
        toolStrip.Visible = toolBarToolStripMenuItem.Checked;
    }

    private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
    {
        statusStrip.Visible = statusBarToolStripMenuItem.Checked;
    }

    private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
    {
        LayoutMdi(MdiLayout.Cascade);
    }

    private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
    {
        LayoutMdi(MdiLayout.TileVertical);
    }

    private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
    {
        LayoutMdi(MdiLayout.TileHorizontal);
    }

    private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
    {
        LayoutMdi(MdiLayout.ArrangeIcons);
    }

    private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
    {
        foreach (Form childForm in MdiChildren)
        {
            childForm.Close();
        }
    }
}

}
code works ok but how do I integrate the code that creates axMapWinGIS component TOGETHER WITH NEW FORM, every time I create a new form, create the mapwingis edit together?

Hello @mickaelschwedler

Couldn’t you create a different Form class, within which you add the Map control from the toolbox in the designer? Then, when you need to add a Map-based MDI form, you would set your childForm = new MapForm().

Would that work?

Regards,
Jerry.

1 Like

Hi ,JerryFaust
Good, my first integration in the group I’m happy.Jerry I’m using Inherited Method, where I create a Method in C#, put axMapWinGIS inside and make a call to the Method to open it together with the new childform I use a button that will also be inherited from MDIParental , by pressing the buttons, the Methods will be installed, thank you for your attention, I’m here to learn every day with you.