Пример #1
0
        private void AddSurfaceToNewTabPage(DesignSurfaceUView surface, string pageName)
        {
            var view = surface.GetView();

            TabPage newPage = new TabPage(pageName);

            newPage.Name = pageName;
            newPage.SuspendLayout();
            view.Dock   = DockStyle.Fill;
            view.Parent = newPage; //- Note this assignment
            this.tbCtrlpDesigner.TabPages.Add(newPage);
            newPage.ResumeLayout();
            //- select the TabPage created
            this.tbCtrlpDesigner.SelectedIndex = this.tbCtrlpDesigner.TabPages.Count - 1;
        }
Пример #2
0
        private bool InitSurfaceText(DesignSurfaceUView surface, Control rootComponent, string text)
        {
            Control view = surface.GetView();

            if (null == view)
            {
                return(false);
            }
            PropertyDescriptorCollection pdc = TypeDescriptor.GetProperties(view);
            //- Sets a PropertyDescriptor to the specific property
            PropertyDescriptor pdS = pdc.Find("Text", false);

            if (null != pdS)
            {
                pdS.SetValue(rootComponent, text);
            }
            return(true);
        }