Irregular shaped Windows Form (C#)

后端 未结 2 1368
一个人的身影
一个人的身影 2020-11-30 03:16

What is the easiest way to do this? Is it possible with managed code?

2条回答
  •  盖世英雄少女心
    2020-11-30 04:00

    this.BackgroundImage = //Image
    this.FormBorderStyle = FormBorderStyle.None;
    this.Width = this.BackgroundImage.Width;
    this.Height = this.BackgroundImage.Height;
    this.TransparencyKey = Color.FromArgb(0, 255, 0); //Contrast Color
    

    This allows you to create a form based on an image, and use transparency index to make it seem as though the form is not rectangular.

提交回复
热议问题