當前位置: 首頁>>代碼示例>>C#>>正文


C# Form.Select方法代碼示例

本文整理匯總了C#中System.Windows.Forms.Form.Select方法的典型用法代碼示例。如果您正苦於以下問題:C# Form.Select方法的具體用法?C# Form.Select怎麽用?C# Form.Select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.Form的用法示例。


在下文中一共展示了Form.Select方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: volverAPadreYCerrar

 public static void volverAPadreYCerrar(Form ventanaPadre, Form ventana)
 {
     ventanaPadre.Visible = true;
     ventanaPadre.Activate();
     ventanaPadre.Select();
     ventana.Close();
 }
開發者ID:julianSelser,項目名稱:clinica,代碼行數:7,代碼來源:AsistenteVistas.cs

示例2: mostrarNuevaVentana

 public static void mostrarNuevaVentana(Form ventanaNueva, Form ventanaPadre)
 {
     ventanaNueva.Visible = true;
     ventanaNueva.Activate();
     ventanaNueva.Select();
     ventanaPadre.Hide();
 }
開發者ID:julianSelser,項目名稱:clinica,代碼行數:7,代碼來源:AsistenteVistas.cs

示例3: EnterLeaveFocusEventTest

		public void EnterLeaveFocusEventTest ()
		{
			if (TestHelper.RunningOnUnix) {
				Assert.Ignore ("Relies on form.Show() synchronously generating WM_ACTIVATE");
			}

			Form f = new Form();
			f.ShowInTaskbar = false;

			f.Name = "Form1";
			ContainerControl cc0 = new ContainerControl();
			cc0.Name = "ContainerControl 0";
			ContainerControl cc1 = new ContainerControl();
			cc1.Name = "ContainerControl 1";
			ContainerControl cc2 = new ContainerControl();
			cc2.Name = "ContainerControl 2";
			Control c1 = new Control();
			c1.Name = "Control 1";
			Control c2 = new Control();
			c2.Name = "Control 2";

			connect(f);
			connect(cc0);
			connect(cc1);
			connect(cc2);
			connect(c1);
			connect(c2);

			cc0.Controls.Add(cc1);
			cc0.Controls.Add(cc2);
			cc1.Controls.Add(c1);
			cc2.Controls.Add(c2);

			f.Controls.Add(cc0);

			sb = new StringBuilder ();
			f.Show ();
			c1.Select();

			Assert.AreEqual (@"OnEnter: ContainerControl 0 System.Windows.Forms.ContainerControl
OnEnter: ContainerControl 1 System.Windows.Forms.ContainerControl
OnEnter: Control 1 System.Windows.Forms.Control
OnGotFocus: Control 1 System.Windows.Forms.Control
",
					 sb.ToString (), "1");

			sb.Length = 0;
			c2.Select();
			Assert.AreEqual (@"OnLeave: Control 1 System.Windows.Forms.Control
OnLeave: ContainerControl 1 System.Windows.Forms.ContainerControl
OnValidating: Control 1 System.Windows.Forms.Control
OnValidated: Control 1 System.Windows.Forms.Control
OnValidating: ContainerControl 1 System.Windows.Forms.ContainerControl
OnValidated: ContainerControl 1 System.Windows.Forms.ContainerControl
OnEnter: ContainerControl 2 System.Windows.Forms.ContainerControl
OnEnter: Control 2 System.Windows.Forms.Control
OnLostFocus: Control 1 System.Windows.Forms.Control
OnGotFocus: Control 2 System.Windows.Forms.Control
",
					 sb.ToString (), "2");

			sb.Length = 0;
			cc1.Select();
			Assert.AreEqual (@"OnLeave: Control 2 System.Windows.Forms.Control
OnLeave: ContainerControl 2 System.Windows.Forms.ContainerControl
OnValidating: Control 2 System.Windows.Forms.Control
OnValidated: Control 2 System.Windows.Forms.Control
OnValidating: ContainerControl 2 System.Windows.Forms.ContainerControl
OnValidated: ContainerControl 2 System.Windows.Forms.ContainerControl
OnEnter: ContainerControl 1 System.Windows.Forms.ContainerControl
OnLostFocus: Control 2 System.Windows.Forms.Control
OnGotFocus: ContainerControl 1 System.Windows.Forms.ContainerControl
",
					 sb.ToString (), "3");

			sb.Length = 0;
			cc2.Select();
			Assert.AreEqual (@"OnLeave: ContainerControl 1 System.Windows.Forms.ContainerControl
OnValidating: ContainerControl 1 System.Windows.Forms.ContainerControl
OnValidated: ContainerControl 1 System.Windows.Forms.ContainerControl
OnEnter: ContainerControl 2 System.Windows.Forms.ContainerControl
OnLostFocus: ContainerControl 1 System.Windows.Forms.ContainerControl
OnGotFocus: ContainerControl 2 System.Windows.Forms.ContainerControl
",
					 sb.ToString (), "4");

			Assert.IsNull (cc2.ActiveControl, "5");

			sb.Length = 0;
			c2.Select();
			Assert.AreEqual (@"OnEnter: Control 2 System.Windows.Forms.Control
OnLostFocus: ContainerControl 2 System.Windows.Forms.ContainerControl
OnGotFocus: Control 2 System.Windows.Forms.Control
",
					 sb.ToString (), "6");

			sb.Length = 0;
			cc1.Select();
			Assert.AreEqual (@"OnLeave: Control 2 System.Windows.Forms.Control
OnLeave: ContainerControl 2 System.Windows.Forms.ContainerControl
//.........這裏部分代碼省略.........
開發者ID:nlhepler,項目名稱:mono,代碼行數:101,代碼來源:FocusTest.cs

示例4: TestPublicMethods


//.........這裏部分代碼省略.........
			//c.PreProcessMessage          ???
			c.RectangleToClient (new Rectangle (0, 0, 100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A20");
			c.Dispose ();
			c = new Form ();
			c.RectangleToScreen (new Rectangle (0, 0, 100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A21");
			c.Dispose ();
			c = new Form ();
			c.Refresh ();
			Assert.IsFalse (c.IsHandleCreated, "A22");
			c.ResetBackColor ();
			Assert.IsFalse (c.IsHandleCreated, "A23");
			c.ResetBindings ();
			Assert.IsFalse (c.IsHandleCreated, "A24");
			c.ResetCursor ();
			Assert.IsFalse (c.IsHandleCreated, "A25");
			c.ResetFont ();
			Assert.IsFalse (c.IsHandleCreated, "A26");
			c.ResetForeColor ();
			Assert.IsFalse (c.IsHandleCreated, "A27");
			c.ResetImeMode ();
			Assert.IsFalse (c.IsHandleCreated, "A28");
			c.ResetRightToLeft ();
			Assert.IsFalse (c.IsHandleCreated, "A29");
			c.ResetText ();
			Assert.IsFalse (c.IsHandleCreated, "A30");
			c.SuspendLayout ();
			Assert.IsFalse (c.IsHandleCreated, "A31");
			c.ResumeLayout ();
			Assert.IsFalse (c.IsHandleCreated, "A32");
			c.Scale (new SizeF (1.5f, 1.5f));
			Assert.IsFalse (c.IsHandleCreated, "A33");
			c.Select ();
			Assert.IsTrue (c.IsHandleCreated, "A34");
			c.Dispose ();
			
			c = new Form ();
			
			c.SelectNextControl (new Control (), true, true, true, true);
			Assert.IsFalse (c.IsHandleCreated, "A35");
			c.SetBounds (0, 0, 100, 100);
			Assert.IsFalse (c.IsHandleCreated, "A36");
			c.Update ();
			Assert.IsFalse (c.IsHandleCreated, "A37");
			
			// Form
			
			c.Activate ();
			Assert.IsFalse (c.IsHandleCreated, "F1");
			
			c.AddOwnedForm (new Form ());
			Assert.IsFalse (c.IsHandleCreated, "F2");
			
			c.Close ();
			Assert.IsFalse (c.IsHandleCreated, "F3");
			
			c.Hide ();
			Assert.IsFalse (c.IsHandleCreated, "F4");
			
			c.LayoutMdi (MdiLayout.Cascade);
			Assert.IsFalse (c.IsHandleCreated, "F5");

#if !MONO
			c.PerformAutoScale ();
			Assert.IsFalse (c.IsHandleCreated, "F6"); 
開發者ID:BrzVlad,項目名稱:mono,代碼行數:67,代碼來源:FormHandleTest.cs

示例5: addGeckoTab

        public void addGeckoTab(string url = "about:blank")
        {
            log("Initialized new tab");
            try
            {
                //EduardoOliveiraAndColinVerhey.MDITabControl code
                Form foobar = new Form();
                //foobar.Location.X = 5;
                //foobar.Location.Y = 502;

                //tabControl2.TabPages.Add(foobar);
                Skybound.Gecko.GeckoWebBrowser browser1 = new Skybound.Gecko.GeckoWebBrowser();
                foobar.Controls.Add(browser1);
                tabControl1.TabPages.Add(foobar);
                foobar.Select();
                foobar.BringToFront();
                tabControl1.SelectItem(tabControl1.TabPages[foobar]);
                foobar.Focus();
                foobar.Activate();
                browser1.Dock = DockStyle.Fill;
                browser1.Navigated += new
                Skybound.Gecko.GeckoNavigatedEventHandler(nav);
                browser1.Navigating += new Skybound.Gecko.GeckoNavigatingEventHandler(browser1_Navigating);
                browser1.ProgressChanged += new
                Skybound.Gecko.GeckoProgressEventHandler(loading);
                browser1.CreateWindow += new
                Skybound.Gecko.GeckoCreateWindowEventHandler(geckoWebBrowser1_CreateWindow);
                browser1.StatusTextChanged += new EventHandler(changing);
                browser1.BackColor = System.Drawing.Color.White;
                browser1.DomMouseDown += new Skybound.Gecko.GeckoDomMouseEventHandler(browser1_DomMouseDown);
                browser1.DocumentCompleted += new EventHandler(browser1_DocumentCompleted);
                //browser1.DomClick += new Skybound.Gecko.GeckoDomEventHandler(browser1_DomClick);
                //1browser1.DomContextMenu += new Skybound.Gecko.GeckoDomMouseEventHandler(browser1_DomContextMenu);
                browser1.NoDefaultContextMenu = true;
                browser1.ContextMenuStrip = mainCM;
                browser1.DocumentTitleChanged += new EventHandler(browser_DocumentTitleChanged);
                //browser1.MouseWheel += new MouseEventHandler(browser1_MouseWheel);
                foobar.GotFocus += new
                EventHandler(select);
                foobar.Disposed +=
                    new EventHandler(dd);

                //browser1.AllowDnsPrefetch = false;
                //browser1.BlockPopups = true;
                foobar.Tag = "-";
                //Thread.Sleep(1000);
                rtab();
                textBox1.Focus();
                foobar.Focus();
                browser1.CreateControl();
                toGo = url;
                foobar.Select();
            }
            catch { }
        }
開發者ID:quantum1423-dustbin,項目名稱:Daedalus,代碼行數:55,代碼來源:Form1.cs


注:本文中的System.Windows.Forms.Form.Select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。