Transparent background on winforms?

前端 未结 9 2093
走了就别回头了
走了就别回头了 2020-11-29 03:39

I wanted to make my windows form transparent so removed the borders, controls and everything leaving only the forms box, then I tried to the BackColor and TransparencyKey to

9条回答
  •  悲哀的现实
    2020-11-29 04:36

    A simple solution to get a transparent background in a windows form is to overwrite the OnPaintBackground method like this:

    protected override void OnPaintBackground(PaintEventArgs e)
    {
        //empty implementation
    }
    

    (Notice that the base.OnpaintBackground(e) is removed from the function)

提交回复
热议问题