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

VB.NET Text Font Style And Color

VB.NET - How To Change Text Font Style And Color In Visual Basic.NET


In This VB.NET Tutorial We Will See How To Change A Label Font Style And Color Using Radio Buttons In Visual Basic .NET Programming Language .


Project Source Code:

Public Class Style_Text

    Private Sub RDB_REGULAR_CheckedChanged(sender As Object, e As EventArgs) Handles RDB_REGULAR.CheckedChanged

        Label1.Font = New Font(Label1.Font.FontFamily, Label1.Font.Size, FontStyle.Regular)

    End Sub

    Private Sub RDB_BOLD_CheckedChanged(sender As Object, e As EventArgs) Handles RDB_BOLD.CheckedChanged

        Label1.Font = New Font(Label1.Font.FontFamily, Label1.Font.Size, FontStyle.Bold)

    End Sub

    Private Sub RDB_UNDERLINE_CheckedChanged(sender As Object, e As EventArgs) Handles RDB_UNDERLINE.CheckedChanged

        Label1.Font = New Font(Label1.Font.FontFamily, Label1.Font.Size, FontStyle.Underline)

    End Sub

    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged

        Label1.Font = New Font(Label1.Font.FontFamily, Label1.Font.Size, FontStyle.Italic)

    End Sub

    Private Sub RDB_STRIKEOUT_CheckedChanged(sender As Object, e As EventArgs) Handles RDB_STRIKEOUT.CheckedChanged

        Label1.Font = New Font(Label1.Font.FontFamily, Label1.Font.Size, FontStyle.Strikeout)

    End Sub

    Private Sub RDB_BLACK_CheckedChanged(sender As Object, e As EventArgs) Handles RDB_BLACK.CheckedChanged

        Label1.ForeColor = Color.Black

    End Sub

    Private Sub RDB_RED_CheckedChanged(sender As Object, e As EventArgs) Handles RDB_RED.CheckedChanged

        Label1.ForeColor = Color.Red

    End Sub

    Private Sub RDB_GREEN_CheckedChanged(sender As Object, e As EventArgs) Handles RDB_GREEN.CheckedChanged

        Label1.ForeColor = Color.Green

    End Sub

    Private Sub RDB_BLUE_CheckedChanged(sender As Object, e As EventArgs) Handles RDB_BLUE.CheckedChanged

        Label1.ForeColor = Color.Blue

    End Sub
End Class

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

vb.net text font style and color




JAVA - How To Change A JTable Background Color, Font Size, Font Color In Java NetBeans

How To Set A Background Color, Font Size, Font Color To A JTable In Java

                                                                                    

In this java Tutorial you will see How You Can Change The BackGround Color Of  Your JTable And Font Size And Color (Foreground) In Java NetBeans .


Project Source Code:

package javaapp;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class JTableColor{
    
    public static void main(String[] args){
        
        JFrame frame = new JFrame();
        JTable table = new JTable();
        
        
        // create columns and rows to fill the jtable
        Object[] columns ={"ID","First Name","Last Name","Age"};

        Object[][] rows ={{"1","Java","JEE","11"},
                          {"2","CSharp","Asp","22"},
                          {"3","Php","Mysql","33"},
                          {"4","Html","Css","44"},
                          {"5","Jquery","JavaScript","55"},
                          {"6","Sql","Oracl","66"},
                          {"7","Ruby","Python","77"},
                          {"8","Xml","Xpath","88"}
        };   
        
        DefaultTableModel model = new DefaultTableModel(rows, columns);
        
        // set the model to the JTable
        table.setModel(model);
        
        // set a Background color to the Jtable
        table.setBackground(Color.decode("#058dc7"));
        
        // set Font To table
        table.setFont(new Font("", 1, 42));
        
        // set height to the table rows
        table.setRowHeight(50);
        
        // set color to the JTable Font
        table.setForeground(Color.white);
        
        JScrollPane pane = new JScrollPane(table);
        
        JPanel panel = new JPanel();
        
        panel.setLayout(new BorderLayout());
        
        panel.add(pane,BorderLayout.CENTER);
        
        frame.setContentPane(panel);

        frame.setSize(900,500);
        
        frame.setLocationRelativeTo(null);
        
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        frame.setVisible(true);
    }
}


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

JTable Java Background Color, Font Size, Font Color.jpg





c# - how to bind a combobox with fonts names

c# - how to bind a combobox with fonts name

                                                                                                                           

In This C# Tutorial We Will See How We Can Populate A ComboBox With Fonts Name And Set The Font Name To A Label Using CSharp Programming Language


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 WindowsFormsApplication1
{
    public partial class ComboBox_Fonts_Names : Form
    {
        public ComboBox_Fonts_Names()
        {
            InitializeComponent();
        }

        private void ComboBox_Fonts_Names_Load(object sender, EventArgs e)
        {
            foreach(FontFamily font in FontFamily.Families)
            {
                comboBox1.Items.Add(font.Name.ToString());
            }
        }

        private void comboBox1_TextChanged(object sender, EventArgs e)
        {
            try
            {
                label1.Font = new Font(comboBox1.Text, label1.Font.Size);
            }
            catch { }
        }
    }
}

=> OutPut :


C# ComboBox With Fonts Names
Populate A ComboBox With Fonts Names In C#