/// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            IActiveView pActiveView = (IActiveView)m_PageLayOutControl.PageLayout;

            IMap pMap = pActiveView.FocusMap;

            IGraphicsContainer pGraphicsContainer = (IGraphicsContainer)pActiveView;

            IMapFrame pMapFrame = (IMapFrame)pGraphicsContainer.FindFrame(pMap);

            IStyleSelector pStyleSelector = new BackgroundSelectorClass();

            bool m_bOK = pStyleSelector.DoModal(m_PageLayOutControl.hWnd);

            if (!m_bOK)
            {
                return;
            }

            IBackground pBackground = (IBackground)pStyleSelector.GetStyle(0);

            pMapFrame.Background = pBackground;

            m_PageLayOutControl.Refresh(esriViewDrawPhase.esriViewBackground, null, null);
        }
Esempio n. 2
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            // TODO: Add backgroud.OnClick implementation

            // TODO: Add CmdBackground.OnClick implementation
            IStyleSelector ipSSelector = new BackgroundSelectorClass();

            if (ipSSelector.DoModal(0))
            {
                IMap map = m_PageLayControl.ActiveView.FocusMap;
                IGraphicsContainer gContainer =
                    m_PageLayControl.ActiveView.GraphicsContainer;
                IMapFrame mapFrame = (IMapFrame)gContainer.FindFrame(map);
                mapFrame.Background = (IBackground)ipSSelector.GetStyle(0);
                m_PageLayControl.ActiveView.Refresh();
            }
        }