How do you set or adjust opacity of controls during runtime? (buttons/textbox/etc)

I've tried this

Public Sub setOpacity(ByVal opacity As Integer)
        Me.BackColor = Color.FromArgb(opacity, 255, 255, 255)
    End Sub

But error returns that it controls does not support opacity.

I want my controls to load on runtime with fade-in effects.

Any links to any tutorial?

I dunno if this helps but i tried this to fade on a form.....

Public Sub mainload()
        Dim sngOpacity As Single
        Mainform.Refresh()
        For sngOpacity = 0 To 1 Step 0.04
            Mainform.Opacity = sngOpacity
            ' Let the form repaint itself.
            Mainform.Refresh()
            ' Create a delay.
            System.Threading.Thread.Sleep(10)
        Next
        Mainform.Opacity = 100%
    End Sub

I dunno if this helps but i tried this to fade on a form.....

Public Sub mainload()
        Dim sngOpacity As Single
        Mainform.Refresh()
        For sngOpacity = 0 To 1 Step 0.04
            Mainform.Opacity = sngOpacity
            ' Let the form repaint itself.
            Mainform.Refresh()
            ' Create a delay.
            System.Threading.Thread.Sleep(10)
        Next
        Mainform.Opacity = 100%
    End Sub

Thats the opacity of the form, controls have no .opacity

yoro,

Have a look at an article at code project.

Thanks

This article has been dead for over six months. Start a new discussion instead.