Affichage des articles dont le libellé est Transparent Menu. Afficher tous les articles
Affichage des articles dont le libellé est Transparent Menu. Afficher tous les articles

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



C# Transparent Menu

How To Make a Transparent Menu Using C#

Transparent Menu In C#


In a Previous C# Tutorial We Did a Transparent Button and in This One We Will See How To Make a Transparent Horizontal Menu Using Panel and Buttons in C# Windows Form Application Using Visual Studio Editor .



WATCH THIS C# TUTORIAL


Project Source Code:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Csharp_Tutorials
{
    public partial class Transparent_Menu : Form
    {
        public Transparent_Menu()
        {
            InitializeComponent();
        }

        private void Transparent_Menu_Load(object sender, EventArgs e)
        {

           // set the panel that contains the buttons to transparent
            panel1.BackColor = Color.FromArgb(70, 0, 0, 0);

            // you can use this code for each buttons
            // or use the foreach loop

            // foreach control in the panel
            foreach (Control control in panel1.Controls)
            {
                // check if the control is a button
                if(control is Button)
                {
                    // convert the control to a button
                    Button btn = (Button) control;

                    // set the button style to flat
                    btn.FlatStyle = FlatStyle.Flat;

                    // set the background color for the button
                    btn.BackColor = Color.FromArgb(120, 0, 0, 0);

                    //button1.FlatAppearance.BorderColor = Color.FromArgb(200,255,255,255);

                    // set the border size
                    btn.FlatAppearance.BorderSize = 0;

                    // set a new background color on mouse over
                    btn.FlatAppearance.MouseOverBackColor = Color.FromArgb(140, 155, 89, 182);

                    // set a new background color on mouse down
                    btn.FlatAppearance.MouseDownBackColor = Color.FromArgb(180, 39, 174, 96);

                    // set button forColor
                    btn.ForeColor = Color.White;

                    // set the font size
                    btn.Font = new Font(btn.Font.FontFamily, 22);

                    // set the cursor to hand
                    btn.Cursor = Cursors.Hand;
                }
            }
        }
    }
}



OUTPUT:


How To Create a Transparent Menu In C#