C# Transparent Button

How To Make a Transparent Button Using C#

Transparent Button In C#


In This C# Tutorial we will See How To Make a Transparent Button 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_Button : Form
    {
        public Transparent_Button()
        {
            InitializeComponent();
        }

        private void Transparent_Button_Load(object sender, EventArgs e)
        {

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

            // set the background color for the button
            // the first number mean how much transparent your background you want to be
            button1.BackColor = Color.FromArgb(100,52, 152, 219);

            // set the border size
            button1.FlatAppearance.BorderSize = 20;

            // set the border color
            button1.FlatAppearance.BorderColor = Color.FromArgb(100,241, 196, 15);

            // set a new background color on mouse over
            button1.FlatAppearance.MouseOverBackColor = Color.FromArgb(100,231, 76, 60);

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


            button1.Parent = pictureBox1;
        }
    }
}




OUTPUT:


How To Make a Transparent Button In C#




Share this

Related Posts

Previous
Next Post »