zoukankan      html  css  js  c++  java
  • 窗体的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

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

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

    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,
    }
    }
  • 相关阅读:
    PaaS 7层动态路由的若干实现
    05-OC对象的内存分析
    04-类与对象的练习(第二个OC的类)
    03-类的声明和实现(第一个OC的类)
    02-类与对象的关系
    01-面向对象和面向过程
    06-BOOL类型的使用
    05-初识OC多文件编程(第4个OC程序)
    04-初识OC多文件编程(第3个OC程序)
    03-第二个OC程序
  • 原文地址:https://www.cnblogs.com/huihuixi/p/7229594.html
Copyright © 2011-2022 走看看