Log in

View Full Version : VB to C#


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)

Mike Temporale
10-02-2003, 01:09 PM
Run it through the VB to C# convertor. It's pretty good


http://www.ellkay.com/ConvertVB2CSharp.htm

tonybarnett13
10-03-2003, 12:25 AM
I've already tried this and it doesn't do a complete conversion as I still get error when I try to run the converted code.

Thanks