Winforms semi-transparent PNG over semi-transparent PNG

前端 未结 2 1899
梦毁少年i
梦毁少年i 2020-12-04 03:25

I think I must be missing something obvious, but I\'m unable to find this after several hours of searching. Is there no way to use a PictureBox or other control to contain

2条回答
  •  独厮守ぢ
    2020-12-04 03:39

    Sorry, I just found this... once I decided to Google for "winforms transparent panel" instead of the searches I was doing before, the TransPictureBox example show seems to do exactly what I need:

    Transparency Problem by Overlapped PictureBox's at C#

    Looks like there are 2 parts to it:

    1. Set WS_EX_TRANSPARENT for the window style

    2. Override the "draw background" method (or optionally could probably make the control style Opaque).

提交回复
热议问题