查看原文:http://blog.xieyc.com/form-border-style/

设置窗体边框可以通过设置窗体的FormBorderStyle属性设置。属性值可以通过枚举类型FormBorderStyle获取,它的取值和意义如下表所示。

属性

意义

FormBorderStyle.None

0

无边框
FormBorderStyle.FixedSingle

1

固定的单行边框
FormBorderStyle.Fixed3D

2

固定的三维样式边框
FormBorderStyle.FixedDialog

3

固定的对话框样式的粗边框
FormBorderStyle.Sizable

4

可调整大小的边框
FormBorderStyle.FixedToolWindow

5

不可调整大小的工具窗口边框
FormBorderStyle.SizableToolWindow

6

可调整大小的工具窗口边框

总是记不住这几个值是什么意义(虽然能够在设计器中观察到大概的外观),因此用下面一个方法遍历一下:

private void btnChangeBorderStyle(object sender, EventArgs e)
{
if (this.FormBorderStyle == System.Windows.Forms.FormBorderStyle.SizableToolWindow)
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
else
this.FormBorderStyle++;
((Button)sender).Text = this.FormBorderStyle.ToString();
}

截图记录在此:

附:枚举源代码

namespace System.Windows.Forms
{
// Summary:
//     Specifies the border styles for a form.
[ComVisible(true)]
public enum FormBorderStyle
{
// Summary:
//     No border.
None = 0,
//
// Summary:
//     A fixed, single-line border.
FixedSingle = 1,
//
// Summary:
//     A fixed, three-dimensional border.
Fixed3D = 2,
//
// Summary:
//     A thick, fixed dialog-style border.
FixedDialog = 3,
//
// Summary:
//     A resizable border.
Sizable = 4,
//
// Summary:
//     A tool window border that is not resizable. A tool window does not appear
//     in the taskbar or in the window that appears when the user presses ALT+TAB.
//     Although forms that specify System.Windows.Forms.FormBorderStyle.FixedToolWindow
//     typically are not shown in the taskbar, you must also ensure that the System.Windows.Forms.Form.ShowInTaskbar
//     property is set to false, since its default value is true.
FixedToolWindow = 5,
//
// Summary:
//     A resizable tool window border. A tool window does not appear in the taskbar
//     or in the window that appears when the user presses ALT+TAB.
SizableToolWindow = 6,
}
}

最新文章

  1. 安卓使用SQlite3数据库无法id主键无法自动增加?不是的。
  2. windows系统下安装MySQL
  3. 对ASP.NET 5和ASP.NET MVC 6应用程序进行集成测试
  4. hdu - 1240 Nightmare && hdu - 1253 胜利大逃亡(bfs)
  5. Centos6.5 nginx+nginx-rtmp配置流媒体服务器
  6. 使用IDEA,利用SpringMVC框架建立HelloWorld项目
  7. java JMS消息队列
  8. javascript笔记整理(函数)
  9. IE6/7中li浮动外边距无法撑开ul的解决方法
  10. js中一个对象中遇到一个相同的key所对应的value值相加
  11. Rsync使用方法
  12. centos系统中php7安装memcached 扩展
  13. centos 6.5升级内核到3.1
  14. docker的安装与启动
  15. 【PAT】B1063 计算谱半径(20 分)
  16. 大数据和hadoop有什么关系?
  17. decimal模块
  18. 使用mysql innodb 使用5.7的json类型遇到的坑和解决办法
  19. XSS(Cross Site Script)
  20. linqtosql 实现数据分页

热门文章

  1. SpringCloud之Feign和Ribbon的选择(五)
  2. spring cloud 2.x版本 Eureka Client服务提供者教程
  3. 机器阅读理解(看各类QA模型与花式Attention)
  4. C++学习笔记3_类.和相关函数
  5. Pandas 时间序列
  6. Hive数据仓库你了解了吗
  7. RocketMQ 主从同步若干问题答疑
  8. 用OpenGL画线
  9. 基于 HTML5 + WebGL 实现 3D 挖掘机系统
  10. re模块的基本使用