当前位置: 首页>>代码示例>>C#>>正文


C# Control.SelectNextControl方法代码示例

本文整理汇总了C#中System.Windows.Forms.Control.SelectNextControl方法的典型用法代码示例。如果您正苦于以下问题:C# Control.SelectNextControl方法的具体用法?C# Control.SelectNextControl怎么用?C# Control.SelectNextControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.Control的用法示例。


在下文中一共展示了Control.SelectNextControl方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SelectNextActiveControl

 // This will select the correct active control in the containerControl (if the passed in control is a containerControl)
 private static void SelectNextActiveControl(Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap)
 {
     ContainerControl container = ctl as ContainerControl;
     if (container != null)
     {
         bool correctParentActiveControl = true;
         if (container.ParentInternal != null)
         {
             IContainerControl c = container.ParentInternal.GetContainerControlInternal();
             if (c != null)
             {
                 c.ActiveControl = container;
                 correctParentActiveControl = (c.ActiveControl == container);
             }
         }
         if (correctParentActiveControl)
         {
             ctl.SelectNextControl(null, forward, tabStopOnly, nested, wrap);
         }
     }
     else
     {
         ctl.Select();
     }
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:26,代码来源:SplitContainer.cs

示例2: textBox_KeyUp

 public static void textBox_KeyUp(Control control, object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         control.SelectNextControl(control, true, true, false, true);
     }
 }
开发者ID:TGHGH,项目名称:Warehouse-2,代码行数:7,代码来源:Util.cs

示例3: CallControlSelectNextControl

		public static object CallControlSelectNextControl(Control c, object[] obj)
		{
			return c.SelectNextControl((Control)obj[0], (bool)obj[1], (bool)obj[2],
				(bool)obj[3], (bool)obj[4]);
		}
开发者ID:HosokawaKenchi,项目名称:powersdr-if-stage,代码行数:5,代码来源:invoke.cs

示例4: TestPublicMethods


//.........这里部分代码省略.........
			// - PointToClient ()
			// - PointToScreen ()
			// - RectangleToClient ()
			// - RectangleToScreen ()
			Control c = new Control ();
			
			c.BringToFront ();
			Assert.IsFalse (c.IsHandleCreated, "A1");
			c.Contains (new Control ());
			Assert.IsFalse (c.IsHandleCreated, "A2");
			c.CreateControl ();
			Assert.IsTrue (c.IsHandleCreated, "A3");
			c = new Control ();
			Graphics g = c.CreateGraphics ();
			g.Dispose ();
			Assert.IsTrue (c.IsHandleCreated, "A4");
			c = new Control ();
			c.Dispose ();
			Assert.IsFalse (c.IsHandleCreated, "A5");
			c = new Control ();
			//DragDropEffects d = c.DoDragDrop ("yo", DragDropEffects.None);
			//Assert.IsFalse (c.IsHandleCreated, "A6");
			//Assert.AreEqual (DragDropEffects.None, d, "A6b");
			//Bitmap b = new Bitmap (100, 100);
			//c.DrawToBitmap (b, new Rectangle (0, 0, 100, 100));
			//Assert.IsFalse (c.IsHandleCreated, "A7");
			//b.Dispose ();
			c.FindForm ();
			Assert.IsFalse (c.IsHandleCreated, "A8");
			c.Focus ();
			Assert.IsFalse (c.IsHandleCreated, "A9");

			c.GetChildAtPoint (new Point (10, 10));
			Assert.IsTrue (c.IsHandleCreated, "A10");
			c.GetContainerControl ();
			c = new Control ();
			Assert.IsFalse (c.IsHandleCreated, "A11");
			c.GetNextControl (new Control (), true);
			Assert.IsFalse (c.IsHandleCreated, "A12");
#if NET_2_0
			c.GetPreferredSize (Size.Empty);
			Assert.IsFalse (c.IsHandleCreated, "A13");
#endif
			c.Hide ();
			Assert.IsFalse (c.IsHandleCreated, "A14");
			c.Invalidate ();
			Assert.IsFalse (c.IsHandleCreated, "A15");
			//c.Invoke (new InvokeDelegate (InvokeMethod));
			//Assert.IsFalse (c.IsHandleCreated, "A16");
			c.PerformLayout ();
			Assert.IsFalse (c.IsHandleCreated, "A17");
			c.PointToClient (new Point (100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A18");
			c = new Control ();
			c.PointToScreen (new Point (100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A19");
			c = new Control ();
			//c.PreProcessControlMessage   ???
			//c.PreProcessMessage          ???
			c.RectangleToClient (new Rectangle (0, 0, 100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A20");
			c = new Control ();
			c.RectangleToScreen (new Rectangle (0, 0, 100, 100));
			Assert.IsTrue (c.IsHandleCreated, "A21");
			c = new Control ();
			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");
#if NET_2_0
			c.Scale (new SizeF (1.5f, 1.5f));
			Assert.IsFalse (c.IsHandleCreated, "A33");
#endif
			c.Select ();
			Assert.IsFalse (c.IsHandleCreated, "A34");
			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");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:101,代码来源:ControlHandleTest.cs

示例5: SelectNextActiveControl

 private static void SelectNextActiveControl(Control ctl, bool forward, bool tabStopOnly, bool nested, bool wrap)
 {
     ContainerControl control = ctl as ContainerControl;
     if (control != null)
     {
         bool flag = true;
         if (control.ParentInternal != null)
         {
             IContainerControl containerControlInternal = control.ParentInternal.GetContainerControlInternal();
             if (containerControlInternal != null)
             {
                 containerControlInternal.ActiveControl = control;
                 flag = containerControlInternal.ActiveControl == control;
             }
         }
         if (flag)
         {
             ctl.SelectNextControl(null, forward, tabStopOnly, nested, wrap);
         }
     }
     else
     {
         ctl.Select();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:SplitContainer.cs

示例6: CursorTop

 protected void CursorTop(Control C)
 {
     C.Focus();
     C.SelectNextControl(C, true, true, true, true);
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:5,代码来源:CommonJobForm.cs

示例7: CursorBottom

 protected void CursorBottom(Control C)
 {
     C.Focus();
     C.SelectNextControl(C, false, true, true, true);
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:5,代码来源:CommonJobForm.cs

示例8: FocusControl

 public static bool FocusControl(Control c, bool forceDrawFocus)
 {
     //focus the control to display its focus rectangle (simulates the behavior of hitting the tab key).
     if (forceDrawFocus)
         ControlHelper.ShowFocus(c);
     if (c.TabStop)
         return c.Focus();
     else
         return c.SelectNextControl(null, true, true, true, true);
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:10,代码来源:ControlHelper.cs


注:本文中的System.Windows.Forms.Control.SelectNextControl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。