Comment mettre un form en plein écran avec deux écrans à affichage étendu
yannel777
Messages postés130Date d'inscriptionlundi 4 mai 2009StatutMembreDernière intervention24 janvier 2023
-
Modifié le 1 juin 2021 à 17:19
vb95
Messages postés3418Date d'inscriptionsamedi 11 janvier 2014StatutContributeurDernière intervention31 mai 2023
-
1 juin 2021 à 02:11
Bonjour,
voici mon code.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim Loc As New Point
Dim WL As String
Dim HL As String
Dim Maxed As String = FormWindowState.Normal
Dim FullScreen As String = False
If FullScreen = False Then
FullScreen = True
If Me.WindowState = FormWindowState.Maximized Then
Me.WindowState = FormWindowState.Normal
Maxed = FormWindowState.Maximized
End If
Loc = Me.Location
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
WL = Me.Width
HL = Me.Height
Me.Height = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height.ToString()
Me.Width = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width.ToString()
Me.Location = New Point(0, 0)
End If
End Sub
Par contre, cela fonctionne que sur un seul écran (primaire) mais pas pour le deuxième écran étendu.