Show() public method

public Show ( IWin32Window owner ) : void
owner IWin32Window
return void
コード例 #1
1
 protected override void OnKeyDown(KeyEventArgs e)
 {
     base.OnKeyDown(e);
     switch (e.KeyCode)
     {
         case Keys.D:
             if (form == null)
             {
                 form = new Form();
                 form.Text = "Undocked Control";
                 form.Width = Width;
                 form.Height = Height;
                 form.FormBorderStyle = FormBorderStyle.SizableToolWindow;
                 this.Controls.Remove(control);
                 form.Controls.Add(control);
                 form.FormClosed += delegate (object sender,FormClosedEventArgs ee)
                 {
                     form.Controls.Remove(control);
                     this.Controls.Add(control);
                     form = null;
                 };
                 form.Show();
             }
             else
             {
                 form.Close();
             }
             break;
     }
 }
コード例 #2
0
ファイル: FormEventTest.cs プロジェクト: GirlD/mono
		public void Activated ()
		{
			if (TestHelper.RunningOnUnix)
				Assert.Ignore ("#3 fails");

			_form = new Form ();
			EventLogger logger = new EventLogger (_form);
			_form.ShowInTaskbar = false;
			Assert.AreEqual (0, logger.CountEvents ("Activated"), "#1");
			_form.Activate ();
			Application.DoEvents ();
			Assert.AreEqual (0, logger.CountEvents ("Activated"), "#2");
			_form.Show ();
			Application.DoEvents ();
			Assert.AreEqual (1, logger.CountEvents ("Activated"), "#3");
			_form.Show ();
			Application.DoEvents ();
			Assert.AreEqual (1, logger.CountEvents ("Activated"), "#4");
			_form.Activate ();
			Application.DoEvents ();
			Assert.AreEqual (1, logger.CountEvents ("Activated"), "#5");
			_form.Hide ();
			Application.DoEvents ();
			Assert.AreEqual (1, logger.CountEvents ("Activated"), "#6");
			_form.Show ();
			Application.DoEvents ();
			Assert.AreEqual (2, logger.CountEvents ("Activated"), "#7");
		}
コード例 #3
0
 public static void ShowForm(Form form, bool show)
 {
     if (form.InvokeRequired)
     {
         form.BeginInvoke(new Action(() =>
         {
             if (show)
             {
                 form.Show();
                 form.BringToFront();
                 form.WindowState = FormWindowState.Normal;
             }
             else
             {
                 form.Hide();
                 form.WindowState = FormWindowState.Minimized;
             }
         }));
     }
     else
     {
         if (show)
         {
             form.Show();
             form.BringToFront();
             form.WindowState = FormWindowState.Normal;
         }
         else
         {
             form.Hide();
             form.WindowState = FormWindowState.Minimized;
         }
     }
 }
コード例 #4
0
ファイル: telaJogos.cs プロジェクト: renancs93/loja_games_git
        private void btnSair_Click(object sender, EventArgs e)
        {
            DialogResult sair = MessageBox.Show("Deseja Sair?", "Sair", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (sair == DialogResult.Yes)
            {
                Close();
                TelaP.Show();
            }
        }
コード例 #5
0
        private void SelectBabys()
        {
            lst           = new ListBox();
            lst.Dock      = System.Windows.Forms.DockStyle.Fill;
            this.listform = new Form();
            listform.Size = new Size(200, 100);
            for (int i = 0; i < this.alBabyInfo.Count; i++)
            {
                neusoft.neuFC.Object.neuObject obj;
                obj = (neusoft.neuFC.Object.neuObject) this.alBabyInfo[i];
                lst.Items.Add(obj.ID + "  " + obj.Name);
            }

            lst.Visible = true;
            lst.Show();
            lst.KeyDown      += new KeyEventHandler(lst_KeyDown);
            lst.DoubleClick  += new EventHandler(lst_DoubleClick);
            listform.Closing += new CancelEventHandler(listform_Closing);
            listform.Controls.Add(lst);
            listform.Text            = "请选择婴儿信息";
            listform.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
            listform.TopMost         = true;

            listform.Show();
            listform.Location = this.chkIsBaby.PointToScreen(new Point(this.chkIsBaby.Width / 2 + this.chkIsBaby.Left, this.chkIsBaby.Height + this.chkIsBaby.Top));
            try
            {
                lst.SelectedIndex = 0;
                lst.Focus();
                lst.LostFocus += new EventHandler(lst_LostFocus);
            }
            catch {}
            return;
        }
        private void stage_1_Entities_Identification_Click(object sender, EventArgs e)
        {
            Form form = new System.Windows.Forms.Form();

            form.Text = "Stage-1 Reverse Engineer : Entities";
            //create a viewer object
            Microsoft.Msagl.GraphViewerGdi.GViewer viewer = new Microsoft.Msagl.GraphViewerGdi.GViewer();
            //create a graph object
            Microsoft.Msagl.Drawing.Graph graph = new Microsoft.Msagl.Drawing.Graph("graph");
            //create the graph content


            foreach (Relation rel  in _masterListRelations)
            {
                Microsoft.Msagl.Drawing.Node newNode = new Microsoft.Msagl.Drawing.Node(rel.relationName);
                newNode.Attr.Shape = Microsoft.Msagl.Drawing.Shape.Box;

                graph.AddNode(newNode);
            }



            //bind the graph to the viewer
            viewer.Graph = graph;
            //associate the viewer with the form
            form.SuspendLayout();
            viewer.Dock = System.Windows.Forms.DockStyle.Fill;
            form.Controls.Add(viewer);
            form.Size = new Size(500, 500);
            form.ResumeLayout();
            //show the form
            form.Show();
        }
コード例 #7
0
        public void GoTo(System.Windows.Forms.Form frmParent, System.Windows.Forms.Form frmChildren, bool OpenMax)
        {
            bool isOpen = true;

            foreach (System.Windows.Forms.Form form in frmParent.MdiChildren)//遍历已打开的MDI
            {
                if (form.Name == frmChildren.Name)
                {
                    //frmChildren.Activate();//赋予焦点
                    //frmChildren.Visible = true;
                    isOpen = false;
                    form.Activate();
                    form.WindowState = System.Windows.Forms.FormWindowState.Maximized;
                    break;
                }
            }
            if (isOpen)                            //如果没有找到相同窗体则打开新窗体
            {
                frmChildren.MdiParent = frmParent; //设置父窗体
                frmChildren.Show();
                if (OpenMax)
                {
                    frmChildren.WindowState = System.Windows.Forms.FormWindowState.Maximized;//设置窗体最大化
                }
            }
        }
コード例 #8
0
 virtual protected void toNPC()
 {
     currentForm.Hide();
     currentState = npcState;
     currentForm  = currentState.StateView();
     currentForm.Show();
 }
コード例 #9
0
 virtual protected void toNavigate()
 {
     currentForm.Hide();
     currentState = navigationState;
     currentForm  = currentState.StateView();
     currentForm.Show();
 }
コード例 #10
0
ファイル: SoylentRibbon.cs プロジェクト: tummykung/soylent
        private void humanMacroBtn_Click(object sender, RibbonControlEventArgs e)
        {
            System.Windows.Forms.Form newForm = new System.Windows.Forms.Form();
            newForm.Width  = 1200;
            newForm.Height = 600;
            //newForm.BackColor = System.Drawing.Color.White;

            // Create the ElementHost control for hosting the
            // WPF UserControl.
            ElementHost host = new ElementHost();

            host.Width  = newForm.Width;
            host.Height = newForm.Height;

            //Word.Range toShorten = Globals.Soylent.Application.Selection.Range;
            int jobNumber = Globals.Soylent.jobManager.generateJobNumber();
            //HumanMacroData newHIT = new HumanMacroData(Globals.Soylent.Application.Selection.Range, jobNumber, HumanMacroData.Separator.Sentence);
            //allHITs[newHIT.job] = newHIT;

            // Create the WPF UserControl.
            HumanMacroDialog hm = new HumanMacroDialog(Globals.Soylent.Application.Selection.Range, jobNumber);

            //hm.setText();

            // Assign the WPF UserControl to the ElementHost control's
            // Child property.
            host.Child = hm;

            // Add the ElementHost control to the form's
            // collection of child controls.
            newForm.Controls.Add(host);
            newForm.Show();

            Globals.Soylent.HITView.Visible = true;
        }
コード例 #11
0
 public static void toNPC(Event e)
 {
     currentForm.Hide();
     currentState = npcState;
     currentForm  = currentState.StateView();
     currentForm.Show();
 }
コード例 #12
0
 public static void toNavigate(Event e = null)
 {
     currentForm.Hide();
     currentState = navigationState;
     currentForm  = currentState.StateView();
     currentForm.Show();
 }
コード例 #13
0
 public static void toInventory()
 {
     currentForm.Hide();
     currentState = inventoryState;
     currentForm  = currentState.StateView();
     currentForm.Show();
 }
コード例 #14
0
ファイル: MDI.cs プロジェクト: PaulNichols/Old-Projects
 private void ShowForm(System.Windows.Forms.Form FormToShow)
 {
     this.MakeControlsTransparent(FormToShow);
     this.AddToolBar(FormToShow);
     FormToShow.MdiParent = this;
     FormToShow.Show();
 }
コード例 #15
0
		static public void ActivateForm(WF.Form form)
		{
			var oldstate = form.WindowState;
			form.WindowState = WF.FormWindowState.Minimized;
			form.Show();
			form.WindowState = oldstate == WF.FormWindowState.Minimized ? WF.FormWindowState.Normal : oldstate;
		}
コード例 #16
0
        public static void Show(Form newForm, Document targetDocument = null, Form parentForm = null)
        {
            AddKeyEvents(newForm);
            if (parentForm == null)
            {
                newForm.StartPosition = FormStartPosition.CenterScreen;
            }
            else
            {
                parentForm.AddOwnedForm(newForm);
                newForm.StartPosition = FormStartPosition.Manual;
                newForm.Location      = new Point(parentForm.Location.X + (parentForm.Width - newForm.Width) / 2, parentForm.Location.Y + (parentForm.Height - newForm.Height) / 2);
            }

            if (targetDocument != null && newForm is IHaveCollector formWithCollector)
            {
                formWithCollector.SetDocument(targetDocument);
            }
            newForm.Show(new ModelessWindowHandle(parentForm));
            newForm.FormClosed += (s, e) =>
            {
                ModelessWindowHandle.BringRevitToFront();
                FocusOwner((Form)s);
            };
        }
コード例 #17
0
 virtual protected void toBattle()
 {
     currentForm.Hide();
     currentState = battleState;
     currentForm  = currentState.StateView();
     currentForm.Show();
 }
コード例 #18
0
        /// <summary>Animante screen notifications</summary>
        /// <param name="blinkTimes">Number of times to flash</param>
        /// <param name="state">Used to display as certain shapes. For now full screen</param>
        public static void Flicker(int blinkTimes, TimerState state = TimerState.Done)
        {
            using (
                var form = new System.Windows.Forms.Form()
            {
                AllowTransparency = true,
                Opacity = 0,
                FormBorderStyle = System.Windows.Forms.FormBorderStyle.None,
                Visible = false,
                ShowInTaskbar = false,
                Size = _defaultFormSize,
                StartPosition = FormStartPosition.CenterScreen,
                WindowState = System.Windows.Forms.FormWindowState.Maximized,
                TopMost = true
            })
            {
                CutFormRegion(form, state);

                FormCenterToScreen(form);

                form.Visible = true;
                form.Show();

                for (int ndx = 1; ndx <= blinkTimes; ndx++)
                {
                    FadeIn(form);
                    FadeOut(form);
                }
            }
        }
コード例 #19
0
 virtual protected void toInventory()
 {
     currentForm.Hide();
     currentState = inventoryState;
     currentForm  = currentState.StateView();
     currentForm.Show();
 }
コード例 #20
0
ファイル: MainForm.cs プロジェクト: xChivalrouSx/HelperApp
 private void CheckAndOpenForm <Form>(System.Windows.Forms.Form formObject)
 {
     if (!Application.OpenForms.OfType <Form>().Any())
     {
         formObject.Show();
     }
 }
コード例 #21
0
        private static DialogResult DisplayForm(object[] parms)
        {
            MenuItem mnu = (MenuItem)parms[0];

            System.Windows.Forms.Form frm = CTechCore.Tools.Forms.IsFormInstantiated(mnu.RuntimeFormType).FirstOrDefault();
            if (frm != null)
            {
                frm.Close();
                frm.Dispose();
                frm = null;
            }

            if (mnu.RequiresParametersOnConstructer)
            {
                frm = (System.Windows.Forms.Form)Activator.CreateInstance(mnu.RuntimeFormType, parms);
            }
            else
            {
                frm = (System.Windows.Forms.Form)Activator.CreateInstance(mnu.RuntimeFormType, new object[] { });
            }
            frm.WindowState   = FormWindowState.Normal;
            frm.StartPosition = FormStartPosition.CenterScreen;
            if (!mnu.DisplayAllFormBeforeLoad)
            {
                frm.MdiParent = CTechCore.Tools.Forms.IsFormInstantiated("frmMain").FirstOrDefault();
                frm.Show();
            }
            else
            {
                frm.ShowDialog();
            }
            return(DialogResult.OK);
        }
コード例 #22
0
 public void MdiShow2(BaseForm frm)
 {
     try
     {
         System.Windows.Forms.Form[] mdiChildren = base.MdiChildren;
         for (int i = 0; i < mdiChildren.Length; i++)
         {
             System.Windows.Forms.Form form = mdiChildren[i];
             if (form.GetType().Equals(frm.GetType()))
             {
                 form.Activate();
                 form.Show();
                 frm.Dispose();
                 return;
             }
         }
         frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
         frm.MdiParent     = this;
         frm.KeyPreview    = true;
         frm.Mainform      = this;
         frm.InitFeatureButton();
         frm.Show();
     }
     catch (System.Exception ex)
     {
         clsPublic.ShowException(ex, this.Text);
     }
 }
コード例 #23
0
ファイル: ExtensibleGUI.cs プロジェクト: oleguchok/SPP-Labs
 private void DefaultPosition(Form form)
 {
     form.Left = 0;
     form.Top = 0;
     form.StartPosition = FormStartPosition.Manual;
     form.Show();
 }
コード例 #24
0
ファイル: MainForm.cs プロジェクト: monzurmorshed/POS
        private void MenuItemClickHandler(object sender, EventArgs e)
        {
            try
            {
                ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender;

                string selectClickedForm = string.Format("SELECT [menu_id] ,[parent_menu_id],[menu_name],[form_name],[menu_level] FROM [IMS].[dbo].[menu] where menu_id='{0}'", clickedItem.Name);
                DataSet ds = dbadmin.ReturnDataSet(selectClickedForm);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    CloseAllRunForm();
                    Type type = Type.GetType("WindowsFormsApplication1." + ds.Tables[0].Rows[0][3].ToString());
                    frmObj = Activator.CreateInstance(type) as Form;
                    frmObj.MdiParent = this;

                    //frmObj1 = Activator.CreateInstance(type) as object;
                    //InsertComand = type.GetMethod("InsertComand");
                    //EditComand = type.GetMethod("EditComand");
                    //DeleteComand = type.GetMethod("DeleteComand");
                    //resize = type.GetMethod("resizeGroupBox");

                    frmObj.Show();

                }
            }
            catch (Exception)
            {

                MessageBox.Show("Form not found. ");
            }
        }
コード例 #25
0
ファイル: PanelTest.cs プロジェクト: KonajuGames/SharpLang
		public void AutoSize ()
		{
			Form f = new Form ();
			f.ShowInTaskbar = false;

			Panel p = new Panel ();
			p.AutoSize = true;
			f.Controls.Add (p);
			
			Button b = new Button ();
			b.Size = new Size (200, 200);
			b.Location = new Point (200, 200);
			p.Controls.Add (b);

			f.Show ();

			Assert.AreEqual (new Size (403, 403), p.ClientSize, "A1");
			
			p.Controls.Remove (b);
			Assert.AreEqual (new Size (200, 100), p.ClientSize, "A2");
			
			p.AutoSizeMode = AutoSizeMode.GrowAndShrink;
			Assert.AreEqual (new Size (0, 0), p.ClientSize, "A3");
			f.Dispose ();
		}
コード例 #26
0
ファイル: FormLogin.cs プロジェクト: DamienGounot/Headline
 private void InitializeForm(System.Windows.Forms.Form mainform)
 {
     mainform.MdiParent = FormContainer.Instance;
     mainform.Show();
     mainform.WindowState = FormWindowState.Maximized;
     this.Hide();
 }
コード例 #27
0
		public void TestTabMovement_DoesLoopCorrectly_ThroughSpannedRowCells()
		{
			using (var form = new Form())
			{
				
				Grid grid1 = new Grid();
				grid1.Redim(40,3);
				grid1.FixedColumns = 1;
				grid1.FixedRows = 1;

				Random rnd = new Random();
				for (int r = 0; r < grid1.RowsCount/2; r++)
				{
					for (int c = 0; c < grid1.ColumnsCount; c++)
					{
						grid1[r * 2, c] = new SourceGrid.Cells.Cell(r*c);
						grid1[r * 2, c].RowSpan = 2;
					}
				}
				
				form.Controls.Add(grid1);
				form.Show();
				
				Assert.AreEqual(true, grid1.Selection.Focus(new Position(0, 0), true));
				Assert.AreEqual(new Position(0, 0), grid1.Selection.ActivePosition);
				
				Assert.AreEqual(true, grid1.Selection.Focus(new Position(1, 0), true));
				Assert.AreEqual(new Position(1, 0), grid1.Selection.ActivePosition);
				
				form.Close();
			}
		}
コード例 #28
0
        public ActiveControlForm()
        {
            InitializeComponent();
            this.IsMdiContainer = true;
            var form1 = new Form
            {
                Text = "form1",
                MdiParent = this,
            };

            var form2 = new Form
            {
                Text = "form2",
                MdiParent = this,
                Controls = {
                    new TextBox {
                        Text = "Textie",
                        Name = "textbox1",
                    },
                }
            };

            listBox1.Items.AddRange(new object[] 
            {
                "Hello",
                "World",
            });
            form1.Show();
            form2.Show();
        }
コード例 #29
0
        public override void OnButtonPress()
        {
            _uiForm = new UIForm1();
            _uiForm.Show();

            //UIForm1.Show();
        }
コード例 #30
0
 /// <summary>
 /// 添加界面
 /// </summary>
 /// <param name="control"></param>
 public void AddControl(string title, WinForms.Control control)
 {
     if (control == null)
     {
         MessageBox.Show("没有配置该插件", "提示");
     }
     else
     {
         if (control is WinForms.Form)
         {
             WinForms.Form frm = control as WinForms.Form;
             if (frm.TopLevel)
             {
                 frm.Show();
                 return;
             }
         }
         //
         WindowsFormsHost formsHost = new WindowsFormsHost
         {
             Child = control
         };
         TabItem item = new TabItem()
         {
             Content = formsHost,
             Header  = title
         };
         control.Show();
         grdTab.Items.Add(item);
         grdTab.SelectedItem = item;
     }
 }
コード例 #31
0
        private void AbreForm(string frm)
        {
            // le pido al compilador que me recupere todos los elementos del asembly (proyecto VISTA) comienzo a recorrer cada elemento devuelto
            foreach (System.Type type in Assembly.GetExecutingAssembly().GetTypes())
            {
                //pregunto si es de tipo Formulario
                if (type.IsSubclassOf(typeof(Form)))
                {
                    // verifico si el nombre del formulario es igual al atributo tag que tiene el nombre del formulario a abrir
                    if (type.Name.ToString() == frm)
                    {
                        //si corresponde creo una _instancia de ese objeto
                        Type t = type as Type;
                        // aplicando reflection invoco el metodo GetInstancia del formulario
                        miFORM = (Form)t.InvokeMember("ObtenerInstancia", BindingFlags.Default | BindingFlags.Static | BindingFlags.Public | BindingFlags.InvokeMethod | BindingFlags.InvokeMethod, null, null, new object[] { this.eUSUARIO }) as System.Windows.Forms.Form;
                        //Configuraciones de diseño
                        miFORM.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
                        miFORM.Text = "::. " + frm.ToUpper(); //TODO: muestra mal
                        miFORM.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
                        miFORM.MaximizeBox = false;

                        //Establezca formulario primario de la ventana secundaria
                        //miFORM.MdiParent = this;

                        //Cascade all child forms.
                        //this.LayoutMdi(System.Windows.Forms.MdiLayout.Cascade);

                        //ejecuto el método show del formulario para que lo muestre
                        miFORM.Show();
                    }
                }
            }
        }
コード例 #32
0
        private void button1_Click(object sender, EventArgs e)
        {
            // 비트맵 이미지 생성
            Bitmap bmp1 = new Bitmap(100, 100, PixelFormat.Format24bppRgb);
            Bitmap bmp2 = new Bitmap(200, 200, PixelFormat.Format32bppArgb);

            Graphics g1 = Graphics.FromImage(bmp1);
            Graphics g2 = Graphics.FromImage(bmp2);

            // 비트맵에 그리기
            g1.FillRectangle(Brushes.Red, new Rectangle(0, 0, 100, 100));

            g2.DrawString("32비트 알파,RGB", this.Font, Brushes.Black, 10, 10);
            g2.DrawEllipse(new Pen(Color.FromArgb(255, 255, 0, 0), 40), new Rectangle(50, 50, 50, 50));
            g2.DrawEllipse(new Pen(Color.FromArgb(150, 0, 255, 0), 40), new Rectangle(100, 50, 50, 50));
            g2.DrawEllipse(new Pen(Color.FromArgb(50, 0, 0, 255), 40), new Rectangle(75, 75, 50, 50));

            g1.Dispose();
            g2.Dispose();

            // 폼 생성 배경 이미지로 출력
            Form form1 = new Form();
            form1.Size = new Size(100, 100);
            form1.BackgroundImage = bmp1;
            form1.Show();

            Form form2 = new Form();
            form2.Size = new Size(200, 200);
            form2.BackgroundImage = bmp2;
            form2.Show();
        }
コード例 #33
0
ファイル: Form0.cs プロジェクト: Aaldert/Chatapplication
 private void button1_MouseClick(object sender, MouseEventArgs e)
 {
     naam = textBox1.Text;
     f1 = new Form1(naam);
     Hide();
     f1.Show();
 }
コード例 #34
0
ファイル: WebsiteScreenshot.cs プロジェクト: DeSciL/Ogama
    /// <summary>
    /// This method creates a new form with a webbrowser of correct size on it,
    /// to make a fullsize website screenhot.
    /// </summary>
    /// <param name="navigatingArgs">The <see cref="WebBrowserNavigatingEventArgs"/> instance containing the event data,
    /// especially the url.</param>
    /// <param name="filename">The filename to save the screenshot to.</param>
    public static void DoScreenshot(WebBrowserNavigatingEventArgs navigatingArgs, string filename)
    {
      newTargetUrl = navigatingArgs.Url;
      newScreenshotFilename = filename;

      var tempBrowser = new WebBrowser();
      var dummyForm = new Form { ClientSize = new Size(1, 1), FormBorderStyle = FormBorderStyle.None };
      dummyForm.ShowInTaskbar = false;
      dummyForm.Controls.Add(tempBrowser);
      dummyForm.Show();
      tempBrowser.ScrollBarsEnabled = true;
      tempBrowser.ScriptErrorsSuppressed = true;
      tempBrowser.DocumentCompleted += WebBrowserDocumentCompleted;

      if (navigatingArgs.TargetFrameName != string.Empty)
      {
        tempBrowser.Navigate(navigatingArgs.Url, navigatingArgs.TargetFrameName);
      }
      else
      {
        tempBrowser.Navigate(newTargetUrl);
      }

      while (tempBrowser.ReadyState != WebBrowserReadyState.Complete)
      {
        Application.DoEvents();
      }

      tempBrowser.Dispose();
    }
コード例 #35
0
ファイル: RichTextBoxTargetTests.cs プロジェクト: ExM/NLog
        public void ActiveFormNegativeTest2()
        {
            RichTextBoxTarget target = new RichTextBoxTarget()
            {
                FormName = "MyForm1",
                UseDefaultRowColoringRules = true,
                Layout = "${level} ${logger} ${message}",
            };

            using (Form form = new Form())
            {
                form.Name = "MyForm1";
                form.WindowState = FormWindowState.Minimized;
                form.Show();

                try
                {
                    target.Initialize(CommonCfg);
                    Assert.Fail("Expected exception.");
                }
                catch (NLogConfigurationException ex)
                {
                    Assert.IsNotNull(ex.InnerException);
                    Assert.AreEqual("Rich text box control name must be specified for RichTextBoxTarget.", ex.InnerException.Message);
                }
            }
        }
コード例 #36
0
 //Форма конфигуратора параметров
 #region
 private void createFormParam()
 {
     formParam = new Form();
     setFormParam();
     formParam.AcceptButton = bParamOK;
     formParam.Show();
 }
コード例 #37
0
        public static void vCargaForma(Form Formulario, Form FormularioPadre, string strText)
        {

            Formulario.Text = strText;

            foreach (Form ctr in FormularioPadre.MdiChildren)
            {
                if (ctr.Text == Formulario.Text)
                {
                    ctr.Focus();
                    Formulario.Dispose();
                    return;
                }

            }            

            Formulario.WindowState = FormWindowState.Maximized;
            Formulario.MdiParent = FormularioPadre;
            Formulario.ControlBox = false;

            Formulario.BackgroundImage = ConsultasIkorMysql.Properties.Resources.fondo;
            Formulario.Icon = ConsultasIkorMysql.Properties.Resources.ToolboxWindow;
            Formulario.BackgroundImageLayout = ImageLayout.Stretch;
            Formulario.Show();
            Formulario.WindowState = FormWindowState.Maximized;
            
        }
コード例 #38
0
 private void ShowNewForm(object sender, EventArgs e)
 {
     Form childForm = new Form();
     childForm.MdiParent = this;
     childForm.Text = "Window " + childFormNumber++;
     childForm.Show();
 }
コード例 #39
0
        /// <summary>
        /// Draws a MessageBox that always stays on top with a title, selectable buttons and an icon
        /// </summary>
        static public DialogResult Show(string message, string title,
            MessageBoxButtons buttons,MessageBoxIcon icon)
        {
            // Create a host form that is a TopMost window which will be the 

            // parent of the MessageBox.

            Form topmostForm = new Form();
            // We do not want anyone to see this window so position it off the 

            // visible screen and make it as small as possible

            topmostForm.Size = new System.Drawing.Size(1, 1);
            topmostForm.StartPosition = FormStartPosition.Manual;
            System.Drawing.Rectangle rect = SystemInformation.VirtualScreen;
            topmostForm.Location = new System.Drawing.Point(rect.Bottom + 10,
                rect.Right + 10);
            topmostForm.Show();
            // Make this form the active form and make it TopMost

            topmostForm.Focus();
            topmostForm.BringToFront();
            topmostForm.TopMost = true;
            // Finally show the MessageBox with the form just created as its owner

            DialogResult result = MessageBox.Show(topmostForm, message, title,
                buttons,icon);
            topmostForm.Dispose(); // clean it up all the way


            return result;
        }
コード例 #40
0
        /// <summary>
        /// 添加界面
        /// </summary>
        /// <param name="control"></param>
        internal void AddControl(string title, WinForms.Control control)
        {
            if (control == null)
            {
                MessageBox.Show("没有配置该插件", "提示");
            }
            else
            {
                if (control is WinForms.Form)
                {
                    WinForms.Form frm = control as WinForms.Form;
                    if (frm.TopLevel)
                    {
                        frm.Show();
                        return;
                    }
                }
                //
                WindowsFormsHost formsHost = new WindowsFormsHost
                {
                    Child = control
                };

                control.Show();
                var panel = new DocumentPanel()
                {
                    Content = formsHost, Caption = title
                };
                documentGroup.Items.Add(panel);
                documentGroup.SelectedTabIndex = documentGroup.Items.Count;
            }
        }
コード例 #41
0
ファイル: FormSurface.cs プロジェクト: ssjjsj/softRender
 public FormSurface(int width, int height)
     : base(width, height)
 {
     bitmap = new Bitmap(width, height);
     form = new Form();
     form.Show();
 }
コード例 #42
0
 private void dlgType_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (this.frmPrev != null)
     {
         frmPrev.Show();
     }
 }
コード例 #43
0
ファイル: Tips.cs プロジェクト: Tyelpion/IronAHK
        // TODO: organise Tips.cs
        /// <summary>
        /// Creates an always-on-top window anywhere on the screen.
        /// </summary>
        /// <param name="Text">
        /// <para>If blank or omitted, the existing tooltip (if any) will be hidden. Otherwise, this parameter is the text to display in the tooltip. To create a multi-line tooltip, use the linefeed character (`n) in between each line, e.g. Line1`nLine2.</para>
        /// <para>If Text is long, it can be broken up into several shorter lines by means of a continuation section, which might improve readability and maintainability.</para>
        /// </param>
        /// <param name="X">The X position of the tooltip relative to the active window (use "CoordMode, ToolTip" to change to screen coordinates). If the coordinates are omitted, the tooltip will be shown near the mouse cursor. X and Y can be expressions.</param>
        /// <param name="Y">The Y position (see <paramref name="X"/>).</param>
        /// <param name="ID">Omit this parameter if you don't need multiple tooltips to appear simultaneously. Otherwise, this is a number between 1 and 20 to indicate which tooltip window to operate upon. If unspecified, that number is 1 (the first).</param>
        public static void ToolTip(string Text, int X, int Y, int ID)
        {
            if (tooltip == null)
            {
                tooltip = new Form
                {
                    Width = 0,
                    Height = 0,
                    Visible = false
                };
                tooltip.Show();
            }

            if (persistentTooltip == null)
                persistentTooltip = new ToolTip
                {
                    AutomaticDelay = 0,
                    InitialDelay = 0,
                    ReshowDelay = 0,
                    ShowAlways = true
                };

            var bounds = Screen.PrimaryScreen.WorkingArea;
            persistentTooltip.Show(Text, tooltip, new Point((bounds.Left - bounds.Right) / 2, (bounds.Bottom - bounds.Top) / 2));
        }
コード例 #44
0
		public void Indexer_ColumnName ()
		{
			Form form = new Form ();
			form.ShowInTaskbar = false;
			form.Controls.Add (_dataGridView);
			form.Show ();

			DataGridViewCellCollection cells = _dataGridView.Rows [0].Cells;

			DataGridViewCell dateCell = cells ["Date"];
			Assert.IsNotNull (dateCell, "#A1");
			Assert.IsNotNull (dateCell.OwningColumn, "#A2");
			Assert.AreEqual ("Date", dateCell.OwningColumn.Name, "#A3");
			Assert.IsNotNull (dateCell.Value, "#A4");
			Assert.AreEqual (new DateTime (2007, 2, 3), dateCell.Value, "#A5");

			DataGridViewCell eventCell = cells ["eVeNT"];
			Assert.IsNotNull (eventCell, "#B1");
			Assert.IsNotNull (eventCell.OwningColumn, "#B2");
			Assert.AreEqual ("Event", eventCell.OwningColumn.Name, "#B3");
			Assert.IsNotNull (eventCell.Value, "#B4");
			Assert.AreEqual ("one", eventCell.Value, "#B5");

			DataGridViewCell registeredCell = cells ["Registered"];
			Assert.IsNotNull (registeredCell, "#C1");
			Assert.IsNotNull (registeredCell.OwningColumn, "#C2");
			Assert.AreEqual ("Registered", registeredCell.OwningColumn.Name, "#C3");
			Assert.IsNotNull (registeredCell.Value, "#C4");
			Assert.AreEqual (false, registeredCell.Value, "#C5");

			form.Dispose ();
		}
コード例 #45
0
 //Форма выбора категории
 #region
 private void createFormCategories()
 {
     formCategories = new Form();
     setFormCategories();
     formCategories.AcceptButton = bCatNext;
     formCategories.Show();
 }
コード例 #46
0
ファイル: GroupBoxTest.cs プロジェクト: Profit0004/mono
		public void AutoSize ()
		{
			if (TestHelper.RunningOnUnix)
				Assert.Ignore ("Dependent on font height and theme, values are for windows.");
				
			Form f = new Form ();
			f.ShowInTaskbar = false;

			GroupBox p = new GroupBox ();
			p.AutoSize = true;
			f.Controls.Add (p);

			Button b = new Button ();
			b.Size = new Size (200, 200);
			b.Location = new Point (200, 200);
			p.Controls.Add (b);

			f.Show ();

			Assert.AreEqual (new Size (406, 419), p.ClientSize, "A1");

			p.Controls.Remove (b);
			Assert.AreEqual (new Size (200, 100), p.ClientSize, "A2");

			p.AutoSizeMode = AutoSizeMode.GrowAndShrink;
			Assert.AreEqual (new Size (6, 19), p.ClientSize, "A3");

			f.Dispose ();
		}
コード例 #47
0
ファイル: Triablo.cs プロジェクト: ngaspar/Triablo
        //load constructor
        public Triablo(Form menu, String fileName, bool timeCheat)
        {
            speaker.Rate = 2;

            this.menu = menu;
            this.timeCheat = timeCheat;

            loadGame(fileName);

            if (loadSucceeded)
            {
                initTriablo();
                logFile("\r\n/**************************/");
                logFile("/*  Starting Triablo Log  */");
                logFile("/*   " + DateTime.Now.ToLocalTime() + "  */");
                logFile("/**************************/");
                log("\r\nYou, " + this.charName + ", a " + this.charRace + " who's a " + this.charClass + " with a " + this.alignment + " alignment, continue your quest to " + questName + "...\r\n");
            }
            else
            {
                menu.Show();
                MessageBox.Show("This is not a valid Triablo Savegame file.");
                this.Close();
            }
        }
コード例 #48
0
ファイル: FormHelper.cs プロジェクト: nicopisapio/SGE
 public void MostrarFormulario(Form parent, Form hijo, string parametro)
 {
     if (parent.ActiveMdiChild != null) parent.ActiveMdiChild.Close();
     hijo.MdiParent = parent;
     hijo.Tag = parametro;
     hijo.Show();
 }
コード例 #49
0
ファイル: GUI.cs プロジェクト: StabilityofWT/MoSoWT
 private void WiFi_Button_Click(object sender, EventArgs e)
 {
     WiFi_Monitor_Button.Enabled = false;
     Wifi_Monitor = new Wifi_Monitor();
     Wifi_Monitor.FormClosing += Wifi_Monitor_FormClosing;
     Wifi_Monitor.Show();
 }
コード例 #50
0
ファイル: WindowsFormsGui.cs プロジェクト: rene-schoene/racr
    // Widgets:

    [AgRule("Widget", "Form")] static Control FormWidget(Ast n)
    {
        var form = new System.Windows.Forms.Form();

        form.Text    = "Questionnaire";
        form.Closed += (object sender, EventArgs e) => { Application.Exit(); };

        var file = new MenuItem("&File");
        var save = new MenuItem("&Save");
        var quit = new MenuItem("&Quit");

        save.Click += (object sender, EventArgs e) => { SaveQuestionnaire(n); };
        quit.Click += (object sender, EventArgs e) => { Application.Exit(); };
        file.MenuItems.Add(save);
        file.MenuItems.Add(quit);
        form.Menu = new MainMenu();
        form.Menu.MenuItems.Add(file);

        var contentBox = new FlowLayoutPanel();

        contentBox.AutoSize      = true;
        contentBox.AutoScroll    = true;
        contentBox.Dock          = DockStyle.Fill;
        contentBox.FlowDirection = FlowDirection.TopDown;
        contentBox.WrapContents  = false;
        form.Controls.Add(contentBox);
        form.Show();
        return(contentBox);
    }
コード例 #51
0
ファイル: GUI.cs プロジェクト: StabilityofWT/MoSoWT
 private void BL_Button_Click(object sender, EventArgs e)
 {
     BL_Monitor_Button.Enabled = false;
     BL_Monitor = new BL_Monitor();
     BL_Monitor.FormClosing += BL_Monitor_FormClosing;
     BL_Monitor.Show();
 }
コード例 #52
0
		public void TestDataSet ()
		{
			// Binding to a DataSet doesn't work unless you specify DataMember
			Form f = new Form ();
			f.ShowInTaskbar = false;
			
			DataSet ds = new DataSet ();
			
			DataTable dt = ds.Tables.Add ("Muppets");

			dt.Columns.Add ("ID");
			dt.Columns.Add ("Name");
			dt.Columns.Add ("Sex");

			dt.Rows.Add (1, "Kermit", "Male");
			dt.Rows.Add (2, "Miss Piggy", "Female");
			dt.Rows.Add (3, "Gonzo", "Male");
			
			DataGridView dgv = new DataGridView ();
			dgv.DataSource = ds;
	
			f.Controls.Add (dgv);
			f.Show ();
			
			Assert.AreEqual (0, dgv.Columns.Count, "A1");
			Assert.AreEqual (0, dgv.Rows.Count, "A2");
			
			dgv.DataMember = "Muppets";

			Assert.AreEqual (3, dgv.Columns.Count, "A3");
			Assert.AreEqual (4, dgv.Rows.Count, "A4");			
			
			f.Dispose ();
		}
コード例 #53
0
ファイル: DecoderTest.cs プロジェクト: mono/csdirac
        private Form createWindow(Decoder dec)
        {
            Form fr = new Form();
            fr.FormClosed += new FormClosedEventHandler(delegate(object sender, FormClosedEventArgs args) { Environment.Exit(0); });
            PictureBox b = new PictureBox();
            b.Size = new Size(dec.format.width, dec.format.height);
            b.Paint += new PaintEventHandler(delegate(object sender, PaintEventArgs args) {
                //Need b.Invoke or not?
                int wait = (1000 * dec.format.frame_rate_denominator) / dec.format.frame_rate_numerator;

                Picture pic = dec.Pull();
                while (pic.status != Decoder.Status.DONE)
                {
                    if (pic != null &&
                       pic.error == null)
                    {
                        b.Image = pic.GetImage();
                    }
                    Thread.Sleep(wait);
                }
            });
            fr.Controls.Add(b);
            fr.Show();
            return fr;
        }
コード例 #54
0
ファイル: Login.cs プロジェクト: stevesloka/bvcms
		private void onLoginLoad(object sender, EventArgs e)
		{
			this.CenterToScreen();
			this.Location = new Point(this.Location.X, this.Location.Y / 2);

			updateViews();

			//if (Program.settings.popupForVersion < 1) {
			//	MessageBox.Show("The Check-In program has been updated,\nplease verify the following settings:\n\n" +
			//		"Login Page\n\n- Server name (e.g. <yourchurch>.tpsdb.com)\n- Username\n- Password\n- Printer\n- Advanced Page Size (Optional)\n\n" +
			//		"Settings Page\n\n- Campus\n- Early Checkin Hours\n- Late Checkin Minutes\n- Checkboxes at the bottom", "New Version", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

			//	Program.settings.setPopupForVersion(1);
			//}

			keyboard = new CommonKeyboard(this);
			keyboard.Show();
			attachKeyboard();

			URL.Text = Program.settings.subdomain;
			username.Text = Program.settings.user;

			if (username.Text.Length > 0) {
				current = password;
				this.ActiveControl = password;
			} else {
				current = URL;
				this.ActiveControl = URL;
			}
		}
コード例 #55
0
 public static void ShowImage(Bitmap bitmap)
 {
     var form = new Form { ClientSize = bitmap.Size };
      var pb = new PictureBox { Image = bitmap, SizeMode = PictureBoxSizeMode.AutoSize };
      form.Controls.Add(pb);
      form.Show();
 }
コード例 #56
0
        private void cmdIngresar_Click(object sender, System.EventArgs e)
        {
            vDB.Usuario  = TbUsuario.Text;
            vDB.Clave    = TbClave.Text;
            vDB.Compania = "";

            vDB.EstablecerLineaConexion();
            String Result = vDB.Abrir();

            if (Result.Equals(""))
            {
                vDB.RegistrarIntentoConexion("");
                vDB.Generar_VisColumnasXML();
                vDB.Compania = "dbo";
                if (mSource != null)
                {
                    mSource.Show();
                }
                vDB.Cerrar();
                this.Dispose();
            }
            else
            {
                MessageBox.Show(this, Result, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #57
0
        public static void GetFormPosition(System.Windows.Forms.Form form)
        {
            string skey;

            // Create registry key for form
            skey = "Software\\OricExplorer\\" + form.Name;
            RegistryKey key = Registry.CurrentUser.OpenSubKey(skey, true);

            // The key doesn't exist, exit
            if (key == null)
            {
                form.Show();
                return;
            }

            // Get window state
            if (key.GetValue("State") == null)
            {
                form.Show();
            }
            else
            {
                if ((string)key.GetValue("State") == "True")
                {
                    form.Show();
                }
                else
                {
                    form.Hide();
                }
            }

            if (key.GetValue("X") != null && key.GetValue("Y") != null)
            {
                form.Location = new Point((int)key.GetValue("X"), (int)key.GetValue("Y"));
            }

            if (key.GetValue("Width") != null)
            {
                form.Width = (int)key.GetValue("Width");
            }

            if (key.GetValue("Height") != null)
            {
                form.Height = (int)key.GetValue("Height");
            }
        }
コード例 #58
0
ファイル: MainForm.cs プロジェクト: Challak/nucleuscoop
        private void btn_Play_Click(object sender, EventArgs e)
        {
            if (btn_Play.Text == "S T O P")
            {
                if (handler.FakeFocus != null)
                {
                    handler.FakeFocus.Abort();
                }
                if (handler != null)
                {
                    Log("Stop button clicked, calling Handler End function");
                    handler.End();
                }
                SetBtnToPlay();
                btn_Play.Enabled = false;
                this.Controls.Clear();
                this.InitializeComponent();
                RefreshGames();

                return;
            }

            btn_Play.Text   = "S T O P";
            btnBack.Enabled = false;

            handler = gameManager.MakeHandler(currentGame);
            handler.Initialize(currentGameInfo, GameProfile.CleanClone(currentProfile));
            handler.Ended += handler_Ended;

            gameManager.Play(handler);
            if (handler.TimerInterval > 0)
            {
                handlerThread = new Thread(UpdateGameManager);
                handlerThread.Start();
            }

            if (currentGame.HideTaskbar)
            {
                User32Util.HideTaskbar();
            }

            if (currentGame.HideDesktop)
            {
                foreach (Screen screen in Screen.AllScreens)
                {
                    System.Windows.Forms.Form hform = new System.Windows.Forms.Form();
                    hform.BackColor       = Color.Black;
                    hform.Location        = new Point(0, 0);
                    hform.Size            = screen.WorkingArea.Size;
                    this.Size             = screen.WorkingArea.Size;
                    hform.FormBorderStyle = FormBorderStyle.None;
                    hform.StartPosition   = FormStartPosition.Manual;
                    //hform.TopMost = true;
                    hform.Show();
                }
            }

            WindowState = FormWindowState.Minimized;
        }
コード例 #59
0
ファイル: frmMain.cs プロジェクト: hiimdat95/Unimos_CNKTHN
 public void CreateMDIForm(System.Windows.Forms.Form frm)
 {
     CreateWaitDialog();
     frm.MdiParent = this;
     frm.Show();
     this.xtraTabbedMdiManager.SelectedPage.Image = imageCollection2.Images[0];
     CloseWaitDialog();
 }
コード例 #60
-1
ファイル: RichTextBoxTargetTests.cs プロジェクト: ExM/NLog
        public void ActiveFormNegativeTest1()
        {
            RichTextBoxTarget target = new RichTextBoxTarget()
            {
                FormName = "MyForm1",
                ControlName = "Control1",
                UseDefaultRowColoringRules = true,
                Layout = "${level} ${logger} ${message}",
                ToolWindow = false,
                Width = 300,
                Height = 200,
            };

            using (Form form = new Form())
            {
                form.Name = "MyForm1";
                form.WindowState = FormWindowState.Minimized;

                //RichTextBox rtb = new RichTextBox();
                //rtb.Dock = DockStyle.Fill;
                //rtb.Name = "Control1";
                //form.Controls.Add(rtb);
                form.Show();
                try
                {
                    target.Initialize(CommonCfg);
                    Assert.Fail("Expected exception.");
                }
                catch (NLogConfigurationException ex)
                {
                    Assert.IsNotNull(ex.InnerException);
                    Assert.AreEqual("Rich text box control 'Control1' cannot be found on form 'MyForm1'.", ex.InnerException.Message);
                }
            }
        }