Form(窗体)的FormBorderStyle属性的不同效果
本文固定链接: 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 | 可调整大小的工具窗口边框 |
总是记不住这几个值是什么意义(虽然能够在设计器中观察到大概的外观),因此用下面一个方法遍历一下:
1
2
3
4
5
6
7
8
|
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();
}
|
截图记录在此:
附:枚举源代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
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,
}
}
|
Form(窗体)的FormBorderStyle属性的不同效果相关推荐
- 测试窗体的FormBorderStyle属性,不同属性所对应的窗体边框显示情况
刚开始做CS窗体的开发,主要使用dotnetbai设计窗体,慢慢整理一些东西上来,目的给自己做个笔记,之前语文老师说过,好记性不如烂笔头--在百度上搜索到的东西,总是有很多地方与自己的对不上,记下自己 ...
- Form类的KeyPreview属性
首先需要知道一个知识点,Form控件,Panel控件和GroupBox控件等容器类控件默认是不接收焦点的,而是负责管理容器中控件的焦点.当容器控件被选中时,默认把焦点传送至容器内Tab顺序为0的控件. ...
- 第四章节 窗体应用(Form窗体)
1. FormBorderStyle属性用于设置窗体的边框样式, 属性默认值为Sizable,运行后窗体大小可拖拽鼠标随意调整. FIxedSignle值,可以让运行后固定窗体大小, 如果将属性值更改 ...
- 解决C#WinForm在设置FormBorderStyle属性=None时出现的窗口大小变化问题
最近在实现一个悬浮球功能时,在设置FormBorderStyle属性=None时遇到了窗口大小和设计时不一致问题,卡了很久,不过最终在网上找到了答案.只需要在Form.Designer.cs文件中加入 ...
- Form窗体添加背景图片
paip.提升用户体验-------在C++ Builder 中为Form窗体添加背景图片 paip.在C++ Builder 中为Form窗体添加背景图片 Form窗体添加背景图片,一般好几种方法: ...
- C#winform 点叉叉按钮关闭一form窗体应用后,后台进程仍在运行的解决办法
文章目录 前言 一.可能的原因1 1.1猜想1 1.2验证 1.3结论 二.可能的原因2 2.1猜想2 2.2验证 2.3结论 三.最终解决办法 3.1出现的原因: 3.2解决办法1 3.3解决办法2 ...
- C# Form窗体添加启动画面
C# Form窗体添加启动画面 目录 C# Form窗体添加启动画面 一.找图片 二.添加窗体 三.提前加载图片窗体 四.自定义显示代码 如果要使你的window软件界面显得牛逼点,就来个驱动图片 ...
- php中enctype属性,PHP_关于form表单中Enctype属性的用法,关于Form表单中Enctype属性的用 - phpStudy...
关于form表单中Enctype属性的用法 关于Form表单中Enctype属性的用法: form表单中的Enctype属性指定将数据发回到服务器时浏览器使用的编码类型. 下面是它的取值说明: mul ...
- 窗体的常用属性和常用事件
文章目录 1 窗体的常用属性 1.1 窗体的常用属性 2 窗体的常用事件 2.1 Load 2.2 FormClosing 2.3 FormClosed 1 窗体的常用属性 1.1 窗体的常用属性 T ...
最新文章
- 从零开始入门 K8s | 有状态应用编排 - StatefulSet
- 【转载】同步和互斥的POSIX支持(互斥锁,条件变量,自旋锁)
- 分析reduce()的原理
- bootstrap弹出框居中
- java jquery用的多吗_[Java教程]如果不用jQuery,Ajax你还能写出多少?
- java中排序函数sort()使用,Arrays.sort()和Collections.sort()
- web 3d 资源库大全
- 学习windows内核一
- 安卓一键新机_新机速递:vivo S7,如7而至;更有Nokia携手一键直达登场
- 程序人生之七:我的 2010
- 蜜雪冰城“土”里刨金
- 再见,百度网盘!新 60MB/s!
- 低速常温离心机S400
- 选购笔记本要看清液晶屏幕及主流技术
- 技术宅文之还电脑屏幕原来的百富美姿态
- wireshark使用抓包详细图文教程
- Javascript-循环
- android 实现磨砂效果_Android(Android5.0)下毛玻璃(磨砂)效果如何实现?
- 网络爬虫-58同城·招聘联系电话js解密
- RFID相关的两个标准协议接口 PC/SC 和 CCID