tonybarnett13
10-02-2003, 07:36 AM
I found the below code and its suppose to create a transparent label. The problem I have is the below code is written in vb can anyone provide me with a c# version.
Public Class TransparentLabel
Inherits System.Windows.Forms.Label
Public Sub New()
MyBase.New()
SetStyle(ControlStyles.DoubleBuffer, False)
End Sub
Protected Overrides ReadOnly Property CreateParams() As
CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams()
cp.ExStyle = cp.ExStyle Or 32
CreateParams = cp
End Get
End Property
End Class
....
lbl = New TransparentLabel()
lbl.BackColor = Color.Transparent
MyPanel.Controls.Add(lbl)
Public Class TransparentLabel
Inherits System.Windows.Forms.Label
Public Sub New()
MyBase.New()
SetStyle(ControlStyles.DoubleBuffer, False)
End Sub
Protected Overrides ReadOnly Property CreateParams() As
CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams()
cp.ExStyle = cp.ExStyle Or 32
CreateParams = cp
End Get
End Property
End Class
....
lbl = New TransparentLabel()
lbl.BackColor = Color.Transparent
MyPanel.Controls.Add(lbl)