VB.NET Transparent Menu

How To Make a Transparent Menu Using Visual Basic.Net 

Transparent Menu In VB.NET

In This VB.Net Tutorial We Will See How To Create a Transparent Vertical Menu Using Panel and Buttons In Visual Basic.Net Programming Language And Visual Studio Editor.

- To Learn More Watch The Video Tutorial Below. 


Project Source Code:

Public Class Transparent_Menu

    Private Sub Transparent_Menu_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        ' white transparent background
        ' Panel1.BackColor = Color.FromArgb(100, 255, 255, 255)

        ' black transparent background
        Panel1.BackColor = Color.FromArgb(100, 0, 0, 0)


        ' set this style to all buttons in the panel1

        For Each c As Control In Panel1.Controls

            If TypeOf c Is Button Then

                Dim btn As Button = c

                ' make the button transparent with a flat style

                btn.FlatStyle = FlatStyle.Flat
                btn.BackColor = Color.FromArgb(170, 0, 0, 0)
                btn.FlatAppearance.BorderSize = 0
                btn.FlatAppearance.MouseOverBackColor = Color.FromArgb(100, 255, 107, 107)
                btn.FlatAppearance.MouseDownBackColor = Color.FromArgb(100, 72, 219, 251)

                ' set a text style
                btn.ForeColor = Color.White
                btn.Font = New Font(Button1.Font.FontFamily, 24)
                btn.Cursor = Cursors.Hand

            End If

        Next

    End Sub

    ' the mouse enter and leave event can be add on the top for loop to all the buttons

    ' button1 mouse enter
    Private Sub Button1_MouseEnter(sender As Object, e As EventArgs) Handles Button1.MouseEnter

        Button1.FlatAppearance.BorderColor = Color.White
        Button1.FlatAppearance.BorderSize = 1

    End Sub

    ' button1 mouse leave
    Private Sub Button1_MouseLeave(sender As Object, e As EventArgs) Handles Button1.MouseLeave

        Button1.FlatAppearance.BorderSize = 0

    End Sub
End Class  
   

///////////////OUTPUT:



How To Create a Transparent Menu In Vbnet



Share this

Related Posts

Previous
Next Post »