我努力让我的形式有新我设置如何设置窗体有一个透明的背景
Me.SetStyle(ControlStyles.SupportsTransparentBackColor, true)
但还是形式在vb.net透明背景
目前该表格显示为具有默认灰色背景
任何人都可以帮忙吗?
编辑:我需要的控件在窗体上是可见的,所以我不觉得不透明度设置为0,将工作
编辑:我试过的透明度关键解决方案,但它不工作。我有一个黑色背景的圆形图像。 OnPaint我将透明度键设置为0,0的img像素,然后给我留下圆形图像(我想要)它隐藏了黑色背景,但我仍然留下了窗体的默认灰色矩形。
下面是我的代码 -
Public Sub New()
Me.SetStyle(ControlStyles.SupportsTransparentBackColor, True)
Me.BackColor = Color.Transparent
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
Me.Timer1.Start()
End Sub
Private Sub frmWoll_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim img As Bitmap = CType(Me.BackgroundImage, Bitmap)
img.MakeTransparent(img.GetPixel(2, 2))
Me.TransparencyKey = img.GetPixel(2, 2)
End Sub
我添加了下面的代码以获取您正在查找的确切内容。 如果需要额外的东西,请发表评论,我会更新相同的 – 2009-02-09 13:32:51