Exemple #1
0
        private void toolStripStatusLabel1_Click(object sender, EventArgs e)
        {
            // add browser tab
            TabPage newBrowserTab = new TabPage();

            // add an underlying browser
            WebBrowser newBrowser = new WebBrowser();
            newBrowser.Dock = DockStyle.Fill;
            newBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);

            // add tab and a browser to the tab control/*
            newBrowserTab.Controls.Add(newBrowser);
            this.tabControl1.TabPages.Add(newBrowserTab);
            newBrowserTab.Name = comboBox1.Text;

            // navigate and focus new tab
            newBrowserTab.Select();
            newBrowser.Navigate("http://krypton-project.webs.com/start");
            newBrowser.Name = "webBrowser2";
            newBrowserTab.Controls.Add(statusStrip1);
        }
Exemple #2
0
        private void webBrowser1_NewWindow(object sender, CancelEventArgs e)
        {
            // add browser tab
            TabPage newBrowserTab = new TabPage();

            // add an underlying browser
            WebBrowser newBrowser = new WebBrowser();
            newBrowser.Dock = DockStyle.Fill;
            newBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);

            // add tab and a browser to the tab control/*
            newBrowserTab.Controls.Add(newBrowser);
            this.tabControl1.TabPages.Add(newBrowserTab);
            newBrowserTab.Name = comboBox1.Text;

            // navigate and focus new tab
            newBrowserTab.Select();
            ((WebBrowser)tabControl1.SelectedTab.Controls[0]).Navigate(((WebBrowser)
                tabControl1.SelectedTab.Controls[0]).StatusText);
            newBrowser.Name = "webBrowser2";
            e.Cancel = true;
        }
Exemple #3
0
 private void newTabToolStripMenuItem_Click(object sender, EventArgs e)
 {
     TabPage tb = new TabPage();
     TextBox tx = new TextBox();
     tx.Font = MaintextBox.Font;
     tx.ScrollBars = ScrollBars.Both;
     tx.TextChanged += (MaintextBox_TextChanged_1);
     tx.Dock = DockStyle.Fill;
     tx.Multiline = true;
     tb.Text = "untitled";
     tb.Controls.Add(tx);
     tabControl.Controls.Add(tb);
     tb.BringToFront();
     tb.Select();
     tb.PerformLayout();
 }
Exemple #4
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog op = new OpenFileDialog();
            op.Filter = filter.ToString();
            if (op.ShowDialog() == DialogResult.OK)
            {
                if (((TextBox)tabControl.SelectedTab.Controls[0]).Text.Length > 0)
                {
                    TabPage tb = new TabPage();
                    TextBox tx = new TextBox();
                    tx.Font = MaintextBox.Font;
                    tx.ScrollBars = ScrollBars.Both;
                    tx.TextChanged += (MaintextBox_TextChanged_1);
                    tx.Dock = DockStyle.Fill;
                    tx.Multiline = true;
                    tb.Text = "untitled";
                    tb.Controls.Add(tx);
                    tabControl.Controls.Add(tb);
                    tb.BringToFront();
                    tb.Select();
                    tb.PerformLayout();
                    using (System.IO.StreamReader sr = new System.IO.StreamReader(op.FileName))
                    {
                        tx.Text = (sr.ReadToEnd());
                        sr.Dispose();
                    }

                }
                else
                {
                    using (System.IO.StreamReader sr = new System.IO.StreamReader(op.FileName))
                    {
                        ((TextBox)tabControl.SelectedTab.Controls[0]).Text = (sr.ReadToEnd());
                        tabControl.SelectedTab.Text = op.FileName;
                        sr.Dispose();
                    }
                }
            }
        }
        private void ModifiData()
        {
            string so = this.gv_SalesOrder.GetFocusedRowCellValue(gv_SalesOrder.Columns.ColumnByFieldName("sSO")).ToString();
            ZX.Win.FunctionParameter FP = new ZX.Win.FunctionParameter();
            FP = (ZX.Win.FunctionParameter)this.Tag;
            FP.pub_Object = so;
            //MessageBox.Show(this.MdiParent.Name.ToString());
            Form f = SystemClass.ApplicationFormMain.LoadFunction("Form_Main_WorkOrd", FP, this.MdiParent);

            System.Windows.Forms.TabPage TP = new System.Windows.Forms.TabPage(f.Text);
            TP.Tag = f;
            TP.ToolTipText = f.Text;
            foreach (Control item in this.ParentForm.Controls)
            {
                if ((item is System.Windows.Forms.TabControl) && (item.Name == "TabControFormList"))
                {
                    TabControl c = (TabControl)item;
                    c.TabPages.Add(TP);
                    c.SelectedTab = TP;
                }
            }
            TP.Select();

            this.Close();
        }
        private void zxPanel1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Form Frm = null;

            Point formPoint = this.PointToClient(Control.MousePosition);//鼠标相对于窗体左上角的坐标

            Point ZxpanelPoint = this.PointToClient(zxPanel1.Location);//zxpanel1的位置

            //两个坐标相减
            Point ItemPoint = new Point((formPoint.X - ZxpanelPoint.X), (formPoint.Y - ZxpanelPoint.Y - 20));

            //foreach (IPaintItem item1 in zxPanel1.m_paintitems)
            //{

            //    MessageBox.Show(formPoint.ToString() + "=" + item1.ItemLocate.ToString() + "+" + ZxpanelPoint.ToString());
            //    //MessageBox.Show(item1.ItemLocate.ToString());
            //}

            IPaintItem item = this.zxPanel1.GetItemAtPoint(ItemPoint);
            if (item != null && item is PaintUnit)
            {
                //string itemname = ZX.Controls.DotNetMagic.Controls.InputBox.InputBox.ShowInputBox();
                //MessageBox.Show(item.ItemName);
                //MessageBox.Show(item.ItemSpace);

                string FunctionID = "";
                FunctionID = item.ItemSpace;//sender.ToString();
                FormMainFP.pub_Object = FunctionID;//为特殊功能做准备

                //判断是否有权限
                string strSqlAUTHORITY = "SELECT * FROM SYS_USER_AUTHORITY where iValidFlag>0 and sFunctionID='" + FunctionID + "' and sRole='" + FormMainFP.Pub_sRole + "'";
                if ((ZX.ZXSystem.DBUtility.DbHelperSQL.Query(strSqlAUTHORITY).Tables[0].Rows.Count) == 0)
                {

                    ////ShowstatusMessage("没有权限访问");
                    //strMessageLable.BackColor = Color.Blue;
                    //strMessageLable.ForeColor = Color.White;
                    //strMessageLable.Text = "没有权限访问";
                    ShowLabelMessage("没有权限访问");
                    return;
                }

                string strSql = "SELECT * FROM SYS_Functions where sFunctionID='" + FunctionID + "'";
                if ((ZX.ZXSystem.DBUtility.DbHelperSQL.Query(strSql).Tables[0].Rows.Count) > 0)
                {
                    zxPanel1.Visible = false;
                }

                if (PeculiarFunction(FunctionID) == false)//判断是不是特殊功能
                {

                    Frm = SystemClass.ApplicationFormMain.LoadFunction(FunctionID, FormMainFP, this);
                    if (Frm != null)
                    {

                        System.Windows.Forms.TabPage TP = new System.Windows.Forms.TabPage(Frm.Text);
                        TP.Tag = Frm;
                        TP.ToolTipText = Frm.Text;
                        this.TabControFormList.TabPages.Add(TP);
                        this.TabControFormList.SelectedTab = TP;
                        TP.Select();

                        AddAgoFormList();

                    }
                }

            }

            //MessageBox.Show("OK");
        }
        /// <summary>
        /// 点击事件
        /// </summary>
        /// <param name="FunctionText">功能名称</param>
        private void ToolNext_Click(string FunctionText)
        {
            string id = ZX.ZXSystem.DBUtility.DbHelperSQL.GetSingle("select sFunctionID  from SYS_FUNCTIONs where sFunctionName like '%" + FunctionText + "%'").ToString();
            Form Frm = null;
            Frm = SystemClass.ApplicationFormMain.LoadFunction(id, FormMainFP, this);
            if (Frm != null)
            {
                System.Windows.Forms.TabPage TP = new System.Windows.Forms.TabPage(Frm.Text);
                TP.Tag = Frm;
                TP.ToolTipText = Frm.Text;
                this.TabControFormList.TabPages.Add(TP);
                this.TabControFormList.SelectedTab = TP;
                TP.Select();

                AddAgoFormList();

            }
        }
        /// <summary>
        /// 为菜单项指定单击事件,以便调用功能
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/>事件内容 instance containing the event data.</param>
        private void ToolNext_Click(object sender, EventArgs e)
        {
            Form Frm = null;
            if (sender.GetType().ToString().IndexOf("Node") > 0)
            {
                string FunctionText = "";
                FunctionText = ((ZX.Controls.DotNetMagic.Controls.Node)(sender)).Text;
                FormMainFP.pub_Object = FunctionText;//为特殊功能做准备
                if (PeculiarFunction(FunctionText) == false)//判断是不是特殊功能
                {
                    ZXPanelVisibleFalse();
                    Frm = SystemClass.ApplicationFormMain.LoadFunction(((ZX.Controls.DotNetMagic.Controls.Node)sender).Tag.ToString(), FormMainFP, this);
                }
            }
            else if (sender.GetType().ToString().IndexOf("ToolStripMenuItem") > 0)
            {
                string FunctionText = "";
                FunctionText = sender.ToString();
                FormMainFP.pub_Object = FunctionText;//为特殊功能做准备
                if (PeculiarFunction(FunctionText) == false)//判断是不是特殊功能
                {

                    ZXPanelVisibleFalse();
                    Frm = SystemClass.ApplicationFormMain.LoadFunction(((ToolStripItem)sender).Tag.ToString(), FormMainFP, this);
                }
            }
            if (Frm != null)
            {
                ZXPanelVisibleFalse();
                System.Windows.Forms.TabPage TP = new System.Windows.Forms.TabPage(Frm.Text);
                TP.Tag = Frm;
                TP.ToolTipText = Frm.Text;
                this.TabControFormList.TabPages.Add(TP);
                this.TabControFormList.SelectedTab = TP;
                TP.Select();

                AddAgoFormList();

            }
        }
 private void Form_Main_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.F11)
     {
         ZX.Win.FunctionParameter FP = new ZX.Win.FunctionParameter();
         FP.ToolStripitemDisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
         FP.functionFormID = "-1";
         ZX.Win.ReflectionFunction RF = new ZX.Win.ReflectionFunction();
         Form frm = RF.LoadMdiForm("ZXSystem.Function.FunManage.dll", "ZXSystem.Function.FunManage.Form_Main_FunManage", this, FP);
         System.Windows.Forms.TabPage TP = new System.Windows.Forms.TabPage(frm.Text);
         TP.Tag = frm;
         this.TabControFormList.TabPages.Add(TP);
         this.TabControFormList.SelectedTab = TP;
         TP.Select();
         this.zxPanel1.Visible = false;
     }
     ///F12重新加载菜单
     if (e.KeyCode == Keys.F12)
     {
         AddMenu();
         AddToolStripMain();
         ZX.Win.SetToolBarIcon SBI1 = new ZX.Win.SetToolBarIcon();
         SBI1.SetImage(Application.StartupPath + @"\Images\TooBarIco\", this.ToolStripMain, ToolStripItemDisplayStyle.ImageAndText);
     }
 }