ListView1.Font = New System.Drawing.Font( "Times New Roman", 15, System.Drawing.FontStyle.Bold)
' changer couleur et police texte listview Dim Vtextcoul As New ColorDialog Dim Vtextfont As New FontDialog ' changer couleur texte listview Public Sub CouleurDuTexteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CouleurDuTexteToolStripMenuItem.Click If Vtextcoul.ShowDialog() = 1 Then listvPlaco.SelectedItems(0).SubItems(0).ForeColor = Vtextcoul.Color End If End Sub ' changer police texte listview Private Sub PoliceDuTexteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PoliceDuTexteToolStripMenuItem.Click If Vtextfont.ShowDialog() = 1 Then listvPla.SelectedItems(0).SubItems(0).Font = Vtextfont.Font End If End Sub
Option Strict On Public Class Form1 Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing My.Settings.macouleur = ListView1.ForeColor My.Settings.mapolice = ListView1.Font My.Settings.Save() End Sub Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load ListView1.ForeColor = My.Settings.macouleur ListView1.Font = My.Settings.mapolice End Sub 'https://plasserre.developpez.com/cours/vb-net/?page=windows-forms4#LX-N-6 'police Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click Dim myFontDialog As FontDialog myFontDialog = New FontDialog() If myFontDialog.ShowDialog() = DialogResult.OK Then ListView1.Font = myFontDialog.Font End If End Sub 'couleur Private Sub Button6_Click(sender As System.Object, e As System.EventArgs) Handles Button6.Click Dim mycolorDialog As ColorDialog mycolorDialog = New ColorDialog() If mycolorDialog.ShowDialog() = DialogResult.OK Then ListView1.ForeColor = mycolorDialog.Color End If End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question