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


C# Control.BringToFront方法代码示例

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


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

示例1: AddSleepingDetailsPanel

 public void AddSleepingDetailsPanel(Control c)
 {
     this.panelWizardSteps.Controls.Add(c);
     c.Dock = DockStyle.Fill;
     c.BringToFront();
     c.Visible = false;
 }
开发者ID:MichelZ,项目名称:MP-TVSeries,代码行数:7,代码来源:ImportWizard.cs

示例2: GetImage

    public static Image GetImage(Control c_)
    {
      Graphics g = null;
      Image ret = null;
      try
      {
        if (c_ is Form)
          c_.BringToFront();
        else
          c_.FindForm().BringToFront();

        Application.DoEvents();

        g = c_.CreateGraphics();
        ret = new Bitmap(c_.ClientRectangle.Width, c_.ClientRectangle.Height, g);
        Graphics g2 = Graphics.FromImage(ret);
        IntPtr dc1 = g.GetHdc();
        IntPtr dc2 = g2.GetHdc();
        BitBlt(dc2, 0, 0, c_.ClientRectangle.Width, c_.ClientRectangle.Height, dc1, 0, 0, 13369376);
        g.ReleaseHdc(dc1);
        g2.ReleaseHdc(dc2);
      }
      finally
      {
        if (g != null)
          g.Dispose();
      }

      return ret;
    }
开发者ID:heimanhon,项目名称:researchwork,代码行数:30,代码来源:Util.cs

示例3: Clear

 public void Clear()
 {
     _childControl = new Panel();
     _childControl.Parent = this;
     _childControl.Dock = DockStyle.Fill;
     _childControl.BringToFront();
 }
开发者ID:umabiel,项目名称:WsdlUI,代码行数:7,代码来源:uc_PanelInfo.cs

示例4: BeginDrag

        private static bool m_IsSimpleDrag = false; // Is this a simple drag?

        #endregion Fields

        #region Methods

        /// <summary>
        /// Returns the DataObject needed for a DoDragDrop, from a specified Control
        /// Used with controls that implement IDragDropEnabled (recommended usage)
        /// </summary>
        /// <param name="_ctrl">Control to get DataObject for</param>
        /// <param name="_invalidate">Invalidate the control or not? 
        /// (Set to true if you need to change the appearance of the control during a DragDrop)</param>
        /// <returns>Control converted to a DataObject ready for dragging</returns>
        public static DataObject BeginDrag(Control _ctrl, bool _invalidate)
        {
            // If not initialized then throw an Exception
            if (!m_Initialized)
                throw new Exception(string.Format("{0} not initialized.",
                    "EIBFormDesigner.Event.DragDropHandler"), null);

            // If this is not a valid control to be dragged, throw an exception
            if (!(_ctrl is IDragDropEnabled))
                throw new ControlInterfaceException(
                    string.Format("[{0}] only accepts controls that implement\n[{1}] for drag operations.\n\nUse {2} instead.",
                    "EIBFormDesigner.Event",
                    "IDragDropEnabled",
                    "BeginSimpleDrag"));

            DataObject doControlToDrag = StoreControl(_ctrl, false);

            // Inform the control that it has begun a drag operation
            ((IDragDropEnabled)_ctrl).StoreLocation();
            ((IDragDropEnabled)_ctrl).IsDragging = true;

            // Set the control up to be in the foreground and invalidate it
            // incase it needs redrawing
            if (_invalidate)
            {
                _ctrl.BringToFront();
                _ctrl.Invalidate();
            }

            // return the converted control as a DataObject
            return doControlToDrag;
        }
开发者ID:harpreetoxyent,项目名称:pnl,代码行数:46,代码来源:DragDropHandler.cs

示例5: DispayControl

        public void DispayControl(Control childControl)
        {
            childControl.Parent = this;
            childControl.Dock = DockStyle.Fill;

            _childControl = childControl;

            _childControl.BringToFront();
        }
开发者ID:umabiel,项目名称:WsdlUI,代码行数:9,代码来源:uc_PanelInfo.cs

示例6: Init

        /// <summary>
        /// Init for basic panebar.
        /// </summary>
        /// <param name="mediator"></param>
        /// <param name="mainControl"></param>
        public void Init(Mediator mediator, Control mainControl)
        {
            m_mediator = mediator;
            m_paneBar = CreatePaneBar();
            Controls.Add(m_paneBar as Control);

            mainControl.Dock = DockStyle.Fill;
            Controls.Add(mainControl);
            mainControl.BringToFront();
        }
开发者ID:sillsdev,项目名称:CarlaLegacy,代码行数:15,代码来源:PaneBarContainer.cs

示例7: CargarControl

 public void CargarControl(Control oControl)
 {
     if (!this.panelContenedor.Controls.Contains(oControl))
     {
         oControl.Dock = DockStyle.Fill;
         this.panelContenedor.Controls.Add(oControl);
     }
     this.panelContenedor.Tag = oControl;
     oControl.BringToFront();
     oControl.Show();
 }
开发者ID:moisesiq,项目名称:aupaga,代码行数:11,代码来源:Principal.cs

示例8: Show

 public static Control Show(Control parent) {
     Control o = new Control();
     o.Location = Point.Empty;
     o.Size = parent.ClientSize;
     o.Parent = parent;
     o.BackgroundImage = Resources.ExpirationHS;
     o.BackgroundImageLayout = ImageLayout.Center;
     o.BackColor = Color.WhiteSmoke;
     o.Show();
     o.BringToFront();
     return o;
 }
开发者ID:windrobin,项目名称:kumpro,代码行数:12,代码来源:WIP.cs

示例9: LoadControlToView

 /// <summary>
 /// Dynamically adds a control to the Mainform
 /// </summary>
 /// <param name="controlInstance"></param>
 /// <param name="layoutPanelName"></param>
 private void LoadControlToView(Control controlInstance, int tableLayoutPosition)
 {
     if (!this.Controls.Contains(controlInstance))
     {
         //this.Visible = false;
         ((TableLayoutPanel)this.Controls["tableLayoutPanel1"]).Controls.Add(controlInstance, tableLayoutPosition, 0);
         controlInstance.Dock = DockStyle.Fill;
         controlInstance.BringToFront();
     }
     else
     {
         QAControl.Instance.BringToFront();
     }
 }
开发者ID:ayodele1,项目名称:B2BTrainingApplication,代码行数:19,代码来源:MainForm.cs

示例10: AddCollapsibleControlFor

        public CollapsibleControl AddCollapsibleControlFor(Control control, int expandedHeight = 50, string label = "Collapsible Control")
        {
            if (expandedHeight == -1)
            {
                expandedHeight = control.Height;
            }

            CollapsibleControl newControl = AddCollapsibleControl(expandedHeight);
            newControl.SuspendLayout();

            newControl.Label = label;
            newControl.Controls.Add(control);
            control.Dock = DockStyle.Fill;
            control.BringToFront();
            
            int m = 3;
            newControl.ResumeLayout();
            return newControl;
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:19,代码来源:CollapsibleContainerStrip.cs

示例11: ExplorerBarItem

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Construct an SimpleExplorerBar
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public ExplorerBarItem(string text, Control hostedControl)
		{
			m_button = new Button();
			m_button.Text = text;
			m_button.Dock = DockStyle.Top;
			m_button.Height = 13 + m_button.Font.Height;
			m_button.Cursor = Cursors.Hand;
			m_button.Click += m_button_Click;
			m_button.Paint += m_button_Paint;
			m_button.MouseEnter += m_button_MouseEnter;
			m_button.MouseLeave += m_button_MouseLeave;

			Controls.Add(m_button);

			m_control = hostedControl;
			SetHostedControlHeight(m_control.Height);
			m_control.Dock = DockStyle.Fill;
			Controls.Add(m_control);
			m_control.BringToFront();

			// Make the expand/collapse glyph width the height of
			// one line of button text plus the fudge factor.
			m_glyphButtonWidth = 13 + Font.Height;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:29,代码来源:ExplorerBarItem.cs

示例12: render

        private async void render(Control c, int y)
        {
            if (!thumbs.ContainsKey(c.Name))
            {
                await Task.Delay(100);
                render(c, y);
                return;
            }

            Controls.Find("console", true)[0].Text += "\n[ -> ] rendering " + c.Name;
            c.Visible = true;
            ((FancyLabel)c).Image = thumbs[c.Name];
            c.BringToFront();
            c.Size = new Size(100, 100);

            if (!((FancyLabel)c).Text.Equals(""))
            {
                ((FancyLabel)c).ImageAlign = ContentAlignment.TopCenter;
            }
        }
开发者ID:lyokofirelyte,项目名称:WCNFileManager,代码行数:20,代码来源:Form1.cs

示例13: TestPublicMethods

		public void TestPublicMethods ()
		{
			// Public Methods that force Handle creation:
			// - CreateControl ()
			// - CreateGraphics ()
			// - GetChildAtPoint ()
			// - Invoke, BeginInvoke throws InvalidOperationException if Handle has not been created
			// - 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");
//.........这里部分代码省略.........
开发者ID:nlhepler,项目名称:mono,代码行数:101,代码来源:ControlHandleTest.cs

示例14: ResetControl

 private void ResetControl(SplitterPanel panel, Control newControl)
 {
     panel.SuspendLayout();
     if (!panel.Controls.Contains(newControl))
         panel.Controls.Add(newControl);
     newControl.BringToFront();
     if (Panel1 == panel)
         m_firstFrontedControl = newControl;
     else
         m_secondFrontedControl = newControl;
     panel.ResumeLayout();
 }
开发者ID:sillsdev,项目名称:CarlaLegacy,代码行数:12,代码来源:CollapsingSplitContainer.cs

示例15: ShowControl

		protected virtual void ShowControl(Control editorControl)
		{
			editorControl.Show();
			editorControl.BringToFront();
			editorControl.Focus();
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:6,代码来源:EditorControlBase.cs


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