VB.Net Transparent Button

How To Make a Transparent Button In Visual Basic.Net 

Transparent Button In VB.Net

In This VB.Net Tutorial We Will See How To  Create Two Buttons With a Transparent Background Using Visual Basic.Net Programming Language And Visual Studio Editor.

- To Learn More Watch The Video Tutorial Below. 


Project Source Code:

Public Class Transparent_Button

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

        ' set background color on mouse over for button1

        Button1.FlatAppearance.MouseOverBackColor = Color.FromArgb(80, 236, 240, 241)

        ' set background color on mouse down

        Button1.FlatAppearance.MouseDownBackColor = Color.FromArgb(200, 236, 240, 241)

         ' set the button1 parent

        Button1.Parent = PictureBox1

         ' set background color on mouse over for button2

        Button2.FlatAppearance.MouseOverBackColor = Color.FromArgb(150, 0, 0, 0)

         ' set background color on mouse down for button2

        Button2.FlatAppearance.MouseDownBackColor = Color.FromArgb(250, 0, 0, 0)

        ' set button2 border size

        Button2.FlatAppearance.BorderSize = 0

        ' set button2 background color

        Button2.BackColor = Color.FromArgb(100, 52, 73, 94)

    End Sub

End Class  
   

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



How To Make a Transparent Button In VB.Net



PYTHON And MySQL - How To Search And Display Data In MySQL Database Using Python Tkinter

PYTHON Code - How To Search Record In MySQL Database And Show The Results Python Tkinter


How To Search And Display Data In MySQL Database Using Python Tkinter

In this Python Tutorial we will learn How To Find Data In MySQL Database With A Specific 
Value From TextField And Display The Result In a Texboxes In Python .
we will use the Tkinter library to create the GUI that incorporates a textbox (Entry) components.


Project Source Code:
import tkinter as tk
from tkinter import *
from tkinter import ttk
import mysql.connector

root = Tk()
root.title("Search Data By ID")

connection = mysql.connector.connect(host='localhost', user='root', password='',
port='3306', database='test_py')
c = connection.cursor()

bkg = "#dddddd"


frame = tk.Frame(root, bg=bkg)

label_id = tk.Label(frame, text="ID: ", font=('verdana',12), bg=bkg)
entry_id = tk.Entry(frame, font=('verdana',12))

label_firstname = tk.Label(frame, text="First Name: ", font=('verdana',12), bg=bkg)
entry_firstname = tk.Entry(frame, font=('verdana',12))

label_lastname = tk.Label(frame, text="Last Name: ", font=('verdana',12), bg=bkg)
entry_lastname = tk.Entry(frame, font=('verdana',12))

label_email = tk.Label(frame, text="Email: ", font=('verdana',12), bg=bkg)
entry_email = tk.Entry(frame, font=('verdana',12))

label_age = tk.Label(frame, text="Age: ", font=('verdana',12), bg=bkg)
entry_age = tk.Entry(frame, font=('verdana',12))


def searchData():

# clear fields
entry_firstname.delete(0,END)
entry_lastname.delete(0,END)
entry_email.delete(0,END)
entry_age.delete(0,END)

# search
user_id = entry_id.get()
search_query = "SELECT * FROM `users_2` WHERE `id` = "+user_id
c.execute(search_query)
userdata = c.fetchone()
entry_firstname.insert(0,userdata[1])
entry_lastname.insert(0,userdata[2])
entry_email.insert(0,userdata[3])
entry_age.insert(0,userdata[4])



button_search = tk.Button(frame, text="Search", font=('verdana',14),fg='#ffffff',
bg='orange', command = searchData)

label_id.grid(row=0, column=0, sticky='e')
entry_id.grid(row=0, column=1, pady=10, padx=10)

label_firstname.grid(row=1, column=0)
entry_firstname.grid(row=1, column=1, pady=10, padx=10)

label_lastname.grid(row=2, column=0)
entry_lastname.grid(row=2, column=1, pady=10, padx=10)

label_email.grid(row=3, column=0, sticky='e')
entry_email.grid(row=3, column=1, pady=10, padx=10)

label_age.grid(row=4, column=0, sticky='e')
entry_age.grid(row=4, column=1, pady=10, padx=10)

button_search.grid(row=5,column=0, columnspan=2, pady=10, padx=10, sticky='nsew')

frame.grid(row=0, column=0)


root.mainloop()


// OUTPUT:
How To Search Values From MySQL Database And Set It Into Textboxes In Python Tkinter




VB.Net Design Form Using Panels

How To Design a Form With Panels In VB.Net 

VB.Net Design Form Using Panels and Labels

In This VB.Net Tutorial  We Will See How To Design a Form With Panels and Labels Using Visual Basic.Net Programming Language And Visual Studio Editor.

- To Learn More Watch The Video Tutorial Below. 


Project Source Code:

Public Class Design_Form_Using_Panels

    ' create variables to set the panels color
    Dim p1Color As Color
    Dim p2Color As Color
    Dim p3Color As Color
    Dim p4Color As Color

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

        p1Color = Panel1.BackColor
        p2Color = Panel2.BackColor
        p3Color = Panel3.BackColor
        p4Color = Panel4.BackColor

    End Sub

    Private Sub Label2_MouseEnter(sender As Object, e As EventArgs) Handles Label2.MouseEnter

        Panel1.BackColor = Color.White
        Label2.ForeColor = p1Color

    End Sub

    Private Sub Label2_MouseLeave(sender As Object, e As EventArgs) Handles Label2.MouseLeave

        Panel1.BackColor = p1Color
        Label2.ForeColor = Color.White

    End Sub

    Private Sub Label1_MouseEnter(sender As Object, e As EventArgs) Handles Label1.MouseEnter

        Panel2.BackColor = Color.White
        Label1.ForeColor = p2Color

    End Sub

    Private Sub Label1_MouseLeave(sender As Object, e As EventArgs) Handles Label1.MouseLeave

        Panel2.BackColor = p2Color
        Label1.ForeColor = Color.White

    End Sub

    Private Sub Label3_MouseEnter(sender As Object, e As EventArgs) Handles Label3.MouseEnter

        Panel3.BackColor = Color.White
        Label3.ForeColor = p3Color

    End Sub

    Private Sub Label3_MouseLeave(sender As Object, e As EventArgs) Handles Label3.MouseLeave

        Panel3.BackColor = p3Color
        Label3.ForeColor = Color.White

    End Sub

    Private Sub Label4_MouseEnter(sender As Object, e As EventArgs) Handles Label4.MouseEnter

        Panel4.BackColor = Color.White
        Label4.ForeColor = p4Color

    End Sub

    Private Sub Label4_MouseLeave(sender As Object, e As EventArgs) Handles Label4.MouseLeave

        Panel4.BackColor = p4Color
        Label4.ForeColor = Color.White

    End Sub
End Class  
   


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



How To Design a Form With Panels Using VB.Net



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#




VB.NET - Calculate Percentage With MySQL

How To Calculate Percentage From MySQL Database In Visual Basic.Net 

Calculate Percentage With MySQL Using Vbnet

In This VB.Net and MySQL Tutorial We Will See How To Calculate and Display the Percentage Values From a MySQL Database Table Using Visual Basic.Net Programming Language And Visual Studio Editor.

- To Learn More Watch The Video Tutorial Below. 


Project Source Code:

Imports MySql.Data.MySqlClient

Public Class calc_percent_form

    ' create the connection with mysql database
    Dim connection As New MySqlConnection("datasource=localhost;port=3306;username=root;password=;database=vbnet_student_db")

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

        Dim totalStd As Integer = Convert.ToInt32(totalStudents())
        Dim totalMaleStd As Integer = Convert.ToInt32(totalMaleStudents())
        Dim totalFemaleStd As Integer = Convert.ToInt32(totalFemaleStudents())

        ' the % formula
        ' (male students * 100) / totale students
        ' (female students * 100) / totale students

        Dim maleStd_p As Double = (totalMaleStd * 100) / totalStd
        Dim femaleStd_p As Double = (totalFemaleStd * 100) / totalStd

        lbl_total_students.Text = totalStd.ToString()
        lbl_total_Male_Students.Text = maleStd_p.ToString("0.00") & "%"
        lbl_total_Female_Students.Text = femaleStd_p.ToString("0.00") & "%"


    End Sub


    'create a function to execute count queries
    Function execQuery(ByVal query As String) As String

        Dim command As New MySqlCommand(query, connection)

        ' open connection
        If connection.State = ConnectionState.Closed Then
            connection.Open()
        End If

        Return command.ExecuteScalar.ToString()

        ' close connection
        If connection.State = ConnectionState.Open Then
            connection.Close()
        End If


    End Function


    ' create a function to return total students
    Function totalStudents() As String

        Return execQuery("SELECT COUNT(*) FROM `student`")

    End Function

    ' create a function to return total MALE students
    Function totalMaleStudents() As String

        Return execQuery("SELECT COUNT(*) FROM `student` WHERE gender = 'MALE'")

    End Function

    ' create a function to return total FEMALE students
    Function totalFemaleStudents() As String

        Return execQuery("SELECT COUNT(*) FROM `student` WHERE gender = 'FEMALE'")

    End Function


End Class  
   


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



How To Calculate Percentage From MySQL Using Vbnet



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