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


C# Control.SendToBack方法代码示例

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


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

示例1: ExtendFrameIntoClientArea

        public static void ExtendFrameIntoClientArea(this Form form, Control glassArea)
        {
            if (IsGlassSupported)
            {
                if (glassArea.Dock != DockStyle.Top)
                {
                    glassArea.Dock = DockStyle.Top;
                    glassArea.SendToBack();
                }
                glassArea.BackColor = Color.Transparent;
                glassArea.Resize += delegate(object sender, EventArgs e)
                {
                    form.Invalidate(glassArea.Region, true);
                };

                form.Paint += delegate(object sender, PaintEventArgs e)
                {
                    using (SolidBrush blackBrush = new SolidBrush(Color.Black))
                    {
                        e.Graphics.FillRectangle(blackBrush, glassArea.ClientRectangle);
                    }
                };

                MARGINS marg;
                marg.Top = glassArea.Height;
                marg.Left = 0;
                marg.Right = 0;
                marg.Bottom = 0;
                DwmExtendFrameIntoClientArea(form.Handle, ref marg);

                glassArea.SetGlassWindowDragable();
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:33,代码来源:Areo.cs

示例2: Stretch

        /// <summary>
        /// 抽屉效果。
        /// </summary>
        private void Stretch(ArrayList alPanel, Control myControl, Control myControl1, int MaxValue, int Increment, int Part, int Part1)
        {
            stretchFlag = false;
            for (; myControl.Height - _titleHeight < MaxValue; )
            {
                System.Threading.Thread.Sleep(1);
                if (myControl1.Height - _titleHeight - Increment <= 0)
                {
                    myControl1.Height = _titleHeight;
                }
                else
                {
                    myControl1.Height -= Increment;
                }

                if (myControl.Height - _titleHeight + Increment >= MaxValue)
                {
                    myControl.Height = MaxValue + _titleHeight;
                }
                else
                {
                    myControl.Height += Increment;
                    myControl.SendToBack();
                }

                if (Part > Part1)
                {
                    for (int i = 0; i < alPanel.Count; i++)
                    {
                        if (i > Part1 && i <= Part)
                        {
                            PanelInfo panelInfo = (PanelInfo)alPanel[i];
                            panelInfo.s_panel.Top -= Increment;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < alPanel.Count; i++)
                    {
                        if (i > Part && i <= Part1)
                        {
                            PanelInfo panelInfo = (PanelInfo)alPanel[i];
                            panelInfo.s_panel.Top += Increment;
                        }
                    }
                }
            }

            for (int i = 0; i < alPanel.Count; i++)
            {
                if (i > 0)
                {
                    PanelInfo panelInfo = (PanelInfo)alPanel[i - 1];
                    PanelInfo panelInfo1 = (PanelInfo)alPanel[i];
                    panelInfo1.s_panel.Top =panelInfo.s_panel.Top + panelInfo.s_panel.Height + _splitHeight;
                }
            }
            stretchFlag = true;
        }
开发者ID:ZoeCheck,项目名称:128_5.6_2010,代码行数:63,代码来源:DrawerMainControl.cs

示例3: Add

		// Add a control to this collection.
		public virtual void Add(Control value)
				{
					if(value != null)
					{	
						if(value.Parent == owner)
						{
							// We are already under this owner, so merely
							// send it to the back of its sibling stack.
							value.SendToBack();
						}
						else
						{
							// Suspend layout on the parent while we do this.
							owner.SuspendLayout();
							try
							{
								// Change the parent to the new owner.
								value.Parent = owner;

								// Assign the next tab order if the control doesnt have one.
								if (value.tabIndex == -1)
								{
									int lastIndex = 0;
									for (int i = 0; i < owner.numChildren; i++)
									{
										int index = owner.children[i].TabIndex;
										if (lastIndex <= index)
											lastIndex = index + 1;
									}
									value.tabIndex = lastIndex;
								}
							}
							finally
							{
								// Resume layout, but don't perform it yet.
								owner.ResumeLayout(false);
							}

							// Now perform layout on the control if necessary.
							if (owner.IsHandleCreated && value.Visible)
							{
								// Make sure the control exists.
								value.CreateControl();
								owner.PerformLayout(value, "Parent");
							}
						}
					}
				}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:49,代码来源:Control.cs

示例4: CheckLabelPosition

        private void CheckLabelPosition(List<Control> controls, Control control, int bottom, int right)
        {
            //if label is in the group box, then add it
            DragableLabel label = control as DragableLabel;
            if (label.Top >= this.Top && (label.Top + label.Height) <= bottom
                && label.Left >= this.Left && (label.Left + label.Width) <= right)
            {
                label.BringToFront();

                if (label.LabelFor != null)
                {
                    label.LabelFor.BringToFront();
                }
            }
            //if the label is not in the group box, then remove it's linked control
            else
            {
                control.SendToBack();
                controls.Remove(control);

                if (label.LabelFor != null && controls.Contains(label.LabelFor))
                {
                    label.LabelFor.SendToBack();
                    controls.Remove(label.LabelFor);
                    controls.Remove(label);
                }
            }
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:28,代码来源:DragableGroupBox.cs


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