OVH Cloud OVH Cloud

affichage fenetre

3 réponses
Avatar
Armando RODRIGUES
Bonjour,
Je voudrais quand je lance mon application, que la fenêtre s'affiche sur
toute la grandeur de l'écran, mais en tenant compte de la barre des taches
de Windows. Voici mon code :
Private Sub Form_Load()
Me.Left = 0
Me.Top = 0
Me.Width = Screen.Width
Me.Height = Screen.Height
End Sub
le problème c'est qu'une partie de la fenêtre reste cachée par la barre des
taches.
comment gérer ça ?
je voudrais pas Maximiser la fenêtre.
Merci pour vos réponses.

3 réponses

Avatar
LE TROLL
Salut,

BorderStyle = 0 dans ta propriété de form, et aussi "windowsState = 2",
en jonglant avec tout ça...
---------

"Armando RODRIGUES" a écrit dans le message de news:
41b31560$0$4161$
Bonjour,
Je voudrais quand je lance mon application, que la fenêtre s'affiche sur
toute la grandeur de l'écran, mais en tenant compte de la barre des taches
de Windows. Voici mon code :
Private Sub Form_Load()
Me.Left = 0
Me.Top = 0
Me.Width = Screen.Width
Me.Height = Screen.Height
End Sub
le problème c'est qu'une partie de la fenêtre reste cachée par la barre
des taches.
comment gérer ça ?
je voudrais pas Maximiser la fenêtre.
Merci pour vos réponses.




Avatar
ng
Salut,

Essaye ceci :

Option Explicit

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Declare Function SystemParametersInfo Lib "user32" Alias
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef
lpvParam As RECT, ByVal fuWinIni As Long) As Long

Private Const SPI_GETWORKAREA = 48

Private Function GetScreenWorkingArea(rWAInf As RECT, bCoordInTwips As
Boolean) As Boolean

If SystemParametersInfo(SPI_GETWORKAREA, 0, rWAInf, 0) <> 0 Then
If bCoordInTwips Then
rWAInf.Right = ScaleX(rWAInf.Right, vbPixels, vbTwips)
rWAInf.Bottom = ScaleY(rWAInf.Bottom, vbPixels, vbTwips)
End If
GetScreenWorkingArea = True
End If

End Function

Private Sub Form_Load()
Dim rScreenWorkingSize As RECT

If GetScreenWorkingArea(rScreenWorkingSize, True) Then
Call Me.Move(0, 0, rScreenWorkingSize.Right,
rScreenWorkingSize.Bottom)
End If


End Sub





--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/

Armando RODRIGUES wrote:
Bonjour,
Je voudrais quand je lance mon application, que la fenêtre s'affiche
sur toute la grandeur de l'écran, mais en tenant compte de la barre
des taches de Windows. Voici mon code :
Private Sub Form_Load()
Me.Left = 0
Me.Top = 0
Me.Width = Screen.Width
Me.Height = Screen.Height
End Sub
le problème c'est qu'une partie de la fenêtre reste cachée par la
barre des taches.
comment gérer ça ?
je voudrais pas Maximiser la fenêtre.
Merci pour vos réponses.


Avatar
Armando R.
Merci ng !...
c'est exactement ce qu'il me fallais.
A+

"ng" a écrit dans le message de news:

Salut,

Essaye ceci :

Option Explicit

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Declare Function SystemParametersInfo Lib "user32" Alias
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long,
ByRef lpvParam As RECT, ByVal fuWinIni As Long) As Long

Private Const SPI_GETWORKAREA = 48

Private Function GetScreenWorkingArea(rWAInf As RECT, bCoordInTwips As
Boolean) As Boolean

If SystemParametersInfo(SPI_GETWORKAREA, 0, rWAInf, 0) <> 0 Then
If bCoordInTwips Then
rWAInf.Right = ScaleX(rWAInf.Right, vbPixels, vbTwips)
rWAInf.Bottom = ScaleY(rWAInf.Bottom, vbPixels, vbTwips)
End If
GetScreenWorkingArea = True
End If

End Function

Private Sub Form_Load()
Dim rScreenWorkingSize As RECT

If GetScreenWorkingArea(rScreenWorkingSize, True) Then
Call Me.Move(0, 0, rScreenWorkingSize.Right,
rScreenWorkingSize.Bottom)
End If


End Sub





--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/

Armando RODRIGUES wrote:
Bonjour,
Je voudrais quand je lance mon application, que la fenêtre s'affiche
sur toute la grandeur de l'écran, mais en tenant compte de la barre
des taches de Windows. Voici mon code :
Private Sub Form_Load()
Me.Left = 0
Me.Top = 0
Me.Width = Screen.Width
Me.Height = Screen.Height
End Sub
le problème c'est qu'une partie de la fenêtre reste cachée par la
barre des taches.
comment gérer ça ?
je voudrais pas Maximiser la fenêtre.
Merci pour vos réponses.