示例#1
0
        public DemoOfRibbonControlExForm()
        {
            InitializeComponent();
            //
            this.MainMenuStrip = this.ribbonControlEx1.MenuStrip;
            //
            RichTextBox richTextBox = new RichTextBox();

            richTextBox.Dock         = DockStyle.Fill;
            richTextBox.TextChanged += new EventHandler(richTextBox_TextChanged);
            richTextBox.Text         = "RibbonControl与RibbonControlEx最大的差别在于其RibbonPages集合接纳的是组件(RibbonPageItem)还是控件(RibbonPage)";
            GISShare.Controls.WinForm.WFNew.Forms.TBForm form = new GISShare.Controls.WinForm.WFNew.Forms.TBForm();
            form.Name      = "Form1";
            form.Text      = "文本窗体";
            form.MdiParent = this;
            form.Size      = new Size(600, 360);
            form.Controls.Add(richTextBox);
            form.Show();
        }
示例#2
0
        private void btnOk_MouseClick(object sender, MouseEventArgs e)
        {
            string strFileName = this.txtFileName.Text;

            //
            if (strFileName.Length <= 0)
            {
                GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("请选择要加载的插件!");
                return;
            }
            //
            if (!System.IO.File.Exists(this.txtFileName.Text))
            {
                GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("文件“" + strFileName + "”已不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //
            if (this.rbCopy.Checked || this.rbCut.Checked)
            {
                if (!System.IO.Directory.Exists(this.m_pBaseHost3.PluginDLLFolder))
                {
                    System.IO.Directory.CreateDirectory(this.m_pBaseHost3.PluginDLLFolder);
                }
                string strFileNameNew = this.m_pBaseHost3.PluginDLLFolder + "\\" + System.IO.Path.GetFileName(strFileName);
                if (System.IO.File.Exists(strFileNameNew))
                {
                    GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("文件“" + strFileNameNew + "”已存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                System.IO.File.Copy(strFileName, strFileNameNew);
                //
                if (this.rbCut.Checked)
                {
                    try
                    {
                        System.IO.File.Delete(strFileName);
                    }
                    catch
                    {
                        GISShare.Controls.WinForm.WFNew.Forms.TBMessageBox.Show("删除文件“" + strFileName + "”失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                //
                strFileName = strFileNameNew;
            }
            //
            this.m_ViewItemListBox = new Controls.WinForm.WFNew.View.ViewItemListBoxItem();
            this.m_ViewItemListBox.ShowHScrollBar = true;
            //
            this.m_pBaseHost3.AppendPluginObject(strFileName);
            //
            if (MessageBox.Show("加载插件完成,是否查看加载信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                GISShare.Controls.WinForm.WFNew.Forms.TBForm form = new GISShare.Controls.WinForm.WFNew.Forms.TBForm();
                form.Text = "插件加载信息";
                form.Controls.Add(new GISShare.Controls.WinForm.WFNew.BaseItemHost(this.m_ViewItemListBox)
                {
                    Dock = DockStyle.Fill
                });
                form.Owner       = this;
                form.ShowIcon    = false;
                form.Size        = new Size(this.Width + 100, this.Height + 100);
                form.MinimizeBox = false;
                //form.MaximizeBox = false;
                form.ShowInTaskbar   = false;
                form.StartPosition   = FormStartPosition.Manual;
                form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
                form.Location        = new Point(this.Location.X + (this.Width - form.Width) / 2, this.Location.Y + (this.Height - form.Height) / 2);
                form.Show();
            }
        }