Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Me.WindowState = FormWindowState.Maximized End Sub Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Dim texte As String = "test largeur" Dim l As Integer = Screen.PrimaryScreen.WorkingArea.Width Dim x As Integer Do x += 1 Loop Until e.Graphics.MeasureString(texte, _ New Font("Arial", x, FontStyle.Regular, GraphicsUnit.Point)).Width >= l e.Graphics.DrawString(texte, New Font("Arial", x), Brushes.Red, 0, 0) End Sub
Avec une boucle, tu peux obtenir la taille de la police à utiliser pour remplir l'écran.
tt
Imagine maintenant que la police n'ait rien de prévu entre les taille 24 et 50
Je me demande ce qui se produit lorsqu'on demande une taille qui n'existe pas.