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创建一个 ...
随机推荐
- android之费电检查 BetterBatteryStats
今天老大给了一个任务,是说我们的应用在后台时,还会比较费电!让我查一下 我立马头大了!无从下手! 一.赶紧百度,得到以下几个信息: ①费电的操作有:大数据量的传输;不停的在网络间切换;解析大量的文本数 ...
- SQL2005中的事务与锁定(二)- 转载
------------------------------------------------------------------------ -- Author : HappyFlyStone ...
- Bonbo Git Server
Install This page covers simple Bonobo Git Server installation. Be sure to check prerequisites page ...
- 由 "select *" 引发的“惨案”
今天凌晨做发布, 要合并多个分数据库的表数据到主数据库中, 有 30+ 分数据库. 前面都比较顺利, 在临近结束时,突然发现一个字段的值插入错误. 有一个表 T,字段分别为 (f1, f2, f3, ...
- win32sdk 编程整理的些资料
#win32sdk编程积累经验# ## ListView ## - 创建imagelist HIMAGELIST hi; HBITMAP hBmp = LoadBitmap(hInst,MAKEINT ...
- Android 常用工具类之SPUtil,可以修改默认sp文件的路径
参考: 1. 利用Java反射机制改变SharedPreferences存储路径 Singleton1900 2. Android快速开发系列 10个常用工具类 Hongyang import ...
- WEB前端常用网站收集
WEB前端常用网站收集整理 w3school.w3schools 前端里.脚本之家.素材家园 17素材.frontopen NEC更好的CSS方案.一些常用的JS实例 Bootstrap 官网 h ...
- C#:实现托盘(任务栏图标与托盘图标互斥)
实现托盘(任务栏图标与托盘图标互斥),并且在点击任务栏图标时实现的最小化与点击最小化按钮分离. 具体如下: 1.向窗体上添加如下控件:MenuStrip menuStrip1, NotifyIcon ...
- 禁用缓存的过滤器Filter
这里是禁用缓存的方法: package com.atguigu.javaweb.cache; import java.io.IOException; import javax.servlet.Filt ...
- c# 中crystal report输出PDF文件
工程中引入以下crystal report的类库crystaldecisions.crystalreports.enginecrystaldecisions.reportsourcecrystalde ...