https://msdn.microsoft.com/en-us/library/t5b5kc41(v=vs.110).aspx

Spacing and Aligning Controls Using Snaplines

Snaplines give you an accurate and intuitive way to align controls on your form.

They appear when you are moving a selected control or controls near a position that would align with another control or set of controls.

Your selection will "snap" to the suggested position as you move it past the other controls.

To arrange controls using snaplines

1.Drag a Button control from the Toolbox onto your form.
2.Move the Button control to the lower-right corner of the form. Note the snaplines that appear as the Button control approaches the bottom and right borders of the form. These snaplines display the recommended distance between the borders of the control and the form.
3.Move the Button control around the borders of the form and note where the snaplines appear. When you are finished, move the Button control near the center of the form.

snapline在你拖动到form边界的时候,会出现。

Aligning to Form and Container Margins

Snaplines help you to align your controls to form and container margins in a consistent manner.

To align controls to form and container margins

 1.Select one of the Button controls and move it close to the right border of the form until a snapline appears.
The snapline's distance from the right border is the sum of the control's Margin property and the form's Padding property values.
snapline到右边界的距离,是控件margin属性以及formpadding属性的值的和。
 
Note:
If the form's Padding property is set to 0,0,0,0, the Windows Forms Designer gives the form a shadowed Padding value of 9,9,9,9. To override this behavior, assign a value other than 0,0,0,0.

1.Change the value of the Button control's Margin property by expanding the Margin entry in the Properties window and setting the Allproperty to 0.

For details, see Walkthrough: Laying Out Windows Forms Controls with Padding, Margins, and the AutoSize Property.

2.Move the Button control close to the right border of the form until a snapline appears. This distance is now given by the value of the form's Padding property.

3.Drag a GroupBox control from the Toolbox onto your form.

4.Change the value of the GroupBox control's Padding property by expanding the Padding entry in the Properties window and setting the Allproperty to 10.

5.Drag a Button control from the Toolbox into the GroupBox control.

6.Move the Button control close to the right border of the GroupBox control until a snapline appears. Move the Button control within theGroupBox control and note where the snaplines appear.

Walkthrough: Arranging Controls on Windows Forms Using Snaplines的更多相关文章

  1. Margin and Padding in Windows Forms Controls

    https://msdn.microsoft.com/en-us/library/ms229627.aspx Margin and Padding Precise placement of contr ...

  2. WPF中实例化Com组件,调用组件的方法时报System.Windows.Forms.AxHost+InvalidActiveXStateException的异常

    WPF中实例化Com组件,调用组件的方法时报System.Windows.Forms.AxHost+InvalidActiveXStateException的异常 在wpf中封装Com组件时,调用组件 ...

  3. Double Buffering Windows Forms

    Double Buffering Windows Forms As much as we would like it not to be the case, graphics can be slow ...

  4. .net chart(图表)控件的使用-System.Windows.Forms.DataVisualization.dll

    这个案例指在介绍微软这套免费又功能强大的图表控件Microsoft Chart Controls for Microsoft .NET Framework 3.5,通过它,可让您的项目及报表,轻松套用 ...

  5. Windows Forms(二)

    导读 1.用VS创建一个Windows Forms程序 2.分析上面的程序 3.Mediator pattern(中介者模式) 4.卡UI怎么办——BackgroundWorker组件 用VS创建一个 ...

  6. C# Vista Command Link Control with Windows Forms

    using System; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; u ...

  7. ystem.Windows.Forms.SplitContainer : ContainerControl, ISupportInitialize

    #region 程序集 System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...

  8. System.Windows.Forms.Control : Component, IOleControl, IOleObject, IOleInPlaceObject, IOleInPlaceActiveObject....

    #region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...

  9. Windows Forms编程实战学习:第三章 菜单

    第三章 菜单 1,控件和容器 所有的Windows Forms控件都是从System.Windows.Forms.Control类继承的,相关类的层次结构如下图所示: MarshalByRefObje ...

随机推荐

  1. 如何把一个java工程打成一个jar包(转载)

    1.jar包有入口(即有main()函数) 选中要打包的工程--->右键选择Export---->java----->Runnable java file----->next- ...

  2. 安装SQLServer2005错误无法在com+目录中安装和配置程序集

    无法在com+目录中安装和配置程序集c:\program files\Microsoft SQL Server\90\DTS\tasks\microsoft.sqlserver.MSMQTASK.DL ...

  3. 字符串核对之Boyer-Moore算法

    算法说明: 在计算机科学里,Boyer-Moore字符串搜索算法是一种非常高效的字符串搜索算法.它由Bob Boyer和J Strother Moore设计于1977年.此算法仅对搜索目标字符串(关键 ...

  4. decimal.tostring()格式

    nt/Decimal.ToString 方法 (String, IFormatProvider)   decimal value = 16325.62m; string specifier; Cult ...

  5. python核心编程学习记录之基础知识

    虽然对python的基础知识有所了解,但是为了更深入的学习,要对python的各种经典书籍进行学习 第一章介绍python的优缺点,略过 第二章介绍python起步,第三章介绍python基础,仅记录 ...

  6. 160906、Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)

    互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,Dubbo是一个分布式服务框架,在这种情况下诞生的.现在核心业务抽取出来,作为独立的服务,使 ...

  7. 常用Git命令

    Git教程:http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 一般来说,日常使用只要 ...

  8. api(接口)文档管理工具

    api(接口)文档管理工具 欢迎光临:博之阅API管理平台  ,做为一个app开发者,还没有用到api管理工具,你就OUT了 点击进入:程序员精华博客大全  

  9. AjaxPro 的基本用法

    通过 Ajax可以直接访问后台的代码 实现的步骤: 一 ,添加 引用 AjaxPro.2.dll 文件 二 配置配置文件 <httpHandlers> <add verb=" ...

  10. 杭电1002-A + B Problem II

    #include<stdio.h>#include<string.h> int main(){    char str1[1001],str2[1001];    int t, ...