Skip to main content
added 438 characters in body
Source Link
M.D.
  • 101
  • 3

On A Form with a split container I added a Map Control docked in one panel and a toccontrol docked the other. I set the mapcontrol to be the buddycontrol of the toccontrol. and added a mouse down event to that has the following code. This works perfectly in ArcGIS 10.2.2, the map expands and contracts and changes the extent as expected. Basically what your button would do.

This functionality works fine out of the box.

    private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
    {
        if (splitContainer1.Panel1Collapsed == true)
        {
            splitContainer1.Panel1Collapsed = false;

        }
        else
            splitContainer1.Panel1Collapsed = true;
    }

If you are using a custom legend, not the toccontrol, the map will still resize as expected. The Resize and re-draw are handled by the mapcontrol, and seem to work fine for me. Based on your other post I would look at your event handling and comment all of the code in them out to see if the controls resize and re-draw properly. From there, I would then add pieces back in to see at what point the re-drawing begins to fail.

On A Form with a split container I added a Map Control docked in one panel and a toccontrol docked the other. I set the mapcontrol to be the buddycontrol of the toccontrol. and added a mouse down event to that has the following code. This works perfectly in ArcGIS 10.2.2, the map expands and contracts and changes the extent as expected. Basically what your button would do.

This functionality works fine out of the box.

    private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
    {
        if (splitContainer1.Panel1Collapsed == true)
        {
            splitContainer1.Panel1Collapsed = false;

        }
        else
            splitContainer1.Panel1Collapsed = true;
    }

On A Form with a split container I added a Map Control docked in one panel and a toccontrol docked the other. I set the mapcontrol to be the buddycontrol of the toccontrol. and added a mouse down event to that has the following code. This works perfectly in ArcGIS 10.2.2, the map expands and contracts and changes the extent as expected. Basically what your button would do.

This functionality works fine out of the box.

    private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
    {
        if (splitContainer1.Panel1Collapsed == true)
        {
            splitContainer1.Panel1Collapsed = false;

        }
        else
            splitContainer1.Panel1Collapsed = true;
    }

If you are using a custom legend, not the toccontrol, the map will still resize as expected. The Resize and re-draw are handled by the mapcontrol, and seem to work fine for me. Based on your other post I would look at your event handling and comment all of the code in them out to see if the controls resize and re-draw properly. From there, I would then add pieces back in to see at what point the re-drawing begins to fail.

Source Link
M.D.
  • 101
  • 3

On A Form with a split container I added a Map Control docked in one panel and a toccontrol docked the other. I set the mapcontrol to be the buddycontrol of the toccontrol. and added a mouse down event to that has the following code. This works perfectly in ArcGIS 10.2.2, the map expands and contracts and changes the extent as expected. Basically what your button would do.

This functionality works fine out of the box.

    private void axMapControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseDownEvent e)
    {
        if (splitContainer1.Panel1Collapsed == true)
        {
            splitContainer1.Panel1Collapsed = false;

        }
        else
            splitContainer1.Panel1Collapsed = true;
    }