Margin and Padding in Windows Forms Controls
https://msdn.microsoft.com/en-us/library/ms229627.aspx
Margin and Padding
Precise placement of controls on your form is a high priority for many applications.
The System.Windows.Forms namespace gives you many layout features to accomplish this.
Two of the most important are the Margin and Padding properties.
Margin
The Margin property defines the space around the control that keeps other controls a specified distance from the control's borders.
Padding
The Padding property defines the space in the interior of a control that keeps the control's content (for example, the value of its Text property) a specified distance from the control's borders.
图示
The following illustration shows the Padding and Margin properties on a control.

There is design-time support for this feature in Visual Studio. Also see Walkthrough: Laying Out Windows Forms Controls with Padding, Margins, and the AutoSize Property.
Margin and Dock
Margin是控件和父容器的距离;Padding是控件作为父容器的时候,和内部其他控件的距离。
实际使用的时候,默认的边界距离【snapline出现的时候】。是控件的margin和父容器的padding的距离之和。
https://msdn.microsoft.com/en-us/library/system.windows.forms.control.margin(v=vs.110).aspx
Setting the Margin property on a docked control has no effect on the distance of the control from the the edges of its container.
关于Margin属性,在控件使用Dock模式的时候,非DockStyle.None的时候,Margin属性不生效。【可以通过父容器的Padding来控制边界】
Margin属性不生效的方式和DockStyle类型有关,DockStyle.Top和Margin.Top对应,设置DockStyle.Top的时候Margin.Top失效。其他的还保持有效
Margin and Padding in Windows Forms Controls的更多相关文章
- Walkthrough: Arranging Controls on Windows Forms Using Snaplines
https://msdn.microsoft.com/en-us/library/t5b5kc41(v=vs.110).aspx Spacing and Aligning Controls Using ...
- System.Windows.Forms.Control : Component, IOleControl, IOleObject, IOleInPlaceObject, IOleInPlaceActiveObject....
#region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...
- ystem.Windows.Forms.SplitContainer : ContainerControl, ISupportInitialize
#region 程序集 System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ...
- System.Windows.Forms
File: winforms\Managed\System\WinForms\DataGridView.cs Project: ndp\fx\src\System.Windows.Forms.cspr ...
- WPF中实例化Com组件,调用组件的方法时报System.Windows.Forms.AxHost+InvalidActiveXStateException的异常
WPF中实例化Com组件,调用组件的方法时报System.Windows.Forms.AxHost+InvalidActiveXStateException的异常 在wpf中封装Com组件时,调用组件 ...
- 体验Visual Studio 2015 Windows Forms应用程序开发与维护
昨天到半夜还没有等到Visual Studio 2015的下载地址,实在熬不住就先休息了.北美地区的时区比北京时间要晚一些,今天早上到公司就看到Visual Studio 2015的下载地址,迅速的将 ...
- Double Buffering Windows Forms
Double Buffering Windows Forms As much as we would like it not to be the case, graphics can be slow ...
- .net chart(图表)控件的使用-System.Windows.Forms.DataVisualization.dll
这个案例指在介绍微软这套免费又功能强大的图表控件Microsoft Chart Controls for Microsoft .NET Framework 3.5,通过它,可让您的项目及报表,轻松套用 ...
- Windows Forms(二)
导读 1.用VS创建一个Windows Forms程序 2.分析上面的程序 3.Mediator pattern(中介者模式) 4.卡UI怎么办——BackgroundWorker组件 用VS创建一个 ...
随机推荐
- JetBrains WebStorm 8 注册码
UserName:William===== LICENSE BEGIN =====45550-1204201000001SzFN0n1bPII7FnAxnt0DDOPJAINauvJkeVJBuE5b ...
- Javascript之回调函数(callback)
1.回调函数定义: 回调函数就是一个通过函数指针调用的函数.如果你把函数的指针(地址)作为参数传递给另一个函数,当这个指针被用为调用它所指向的函数时,我们就说这是回调函数.回调函数不是由该函数的实现方 ...
- MapReduce之Mapper类,Reducer类中的函数(转载)
Mapper类4个函数的解析 Mapper有setup(),map(),cleanup()和run()四个方法.其中setup()一般是用来进行一些map()前的准备工作,map()则一般承担主要的处 ...
- linux设备驱动归纳总结(五):1.在内核空间分配内存【转】
本文转载自:http://blog.chinaunix.net/uid-25014876-id-79134.html linux设备驱动归纳总结(五):1.在内核空间分配内存 xxxxxxxxxxxx ...
- html插入视频
http://www.jb51.net/web/168548.html http://www.w3school.com.cn/html/html_media.asp
- laravel数据库的创建和迁移
数据库建立及迁移 Laravel 5 把数据库配置的地方改到了 `learnlaravel5/.env`,打开这个文件,编辑下面四项,修改为正确的信息: ? 1 2 3 4 5 6 7 DB_HOST ...
- JS调用Java函数--DWR框架
(1)dwr与ssh框架整合教程dwr框架介绍. DWR(Direct Web Remoting)是一个用于改善web页面与Java类交互的远程服务器端Ajax开源框架,可以帮助开发人员开发包含AJA ...
- hide your website's wordpress info/path/way
Hide Wordpress Info of your website plugin hide-wp 使用apache语句和wp方法重写 但这个插件有个局限就是,你的网站使用的wordpress的话, ...
- halcon学习笔记——机器视觉工程应用的开发思路【转】
转自:http://www.cnblogs.com/hanzhaoxin/archive/2013/02/15/2912879.html 机器视觉工程应用主要可划分为硬件和软件两大部分. 硬件:工程应 ...
- java多线程中的生产者与消费者之等待唤醒机制@Version2.0
二.生产者消费者模式的学生类成员变量生产与消费demo, @Version2.0 在学生类中添加同步方法:synchronized get()消费者,synchronized set()生产者 最终版 ...