How to paint borders of Windows form in C# Winforms?

↘锁芯ラ 提交于 2019-12-12 18:14:48

问题


How to show our Winforms as MetroUI .. Without using 3rd party dll... I mean How to paint the borders of form

      [Form1_______________-|[]|X] <- I Can able to change the color of this part
     |                          |
     |                          |<- I cant change the color of this part
    -|                          |
    ||__________________________|
    |          |-> I cant change the color of this part
    V
    I cant change the color of this part

I dont this ..but it gives static color i want to change the color...so pls give me ideas in this

  public Form1()
    {
        InitializeComponent();
        Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 0, 0));


    }
    [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
    private static extern IntPtr CreateRoundRectRgn
    (
        int nLeftRect, // x-coordinate of upper-left corner
        int nTopRect, // y-coordinate of upper-left corner
        int nRightRect, // x-coordinate of lower-right corner
        int nBottomRect, // y-coordinate of lower-right corner
        int nWidthEllipse, // height of ellipse
        int nHeightEllipse // width of ellipse
     );

来源:https://stackoverflow.com/questions/12384422/how-to-paint-borders-of-windows-form-in-c-sharp-winforms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!