OVH Cloud OVH Cloud

Pouvoir mettre les feuille en mode plein écran

4 réponses
Avatar
tit-homme
Est-t-il possible de mettre les feuilles d'un projet en mode plein écran? Si
oui comment et surtout quelle est le codage. Merci

4 réponses

Avatar
Jacques
Bonjour,

tit-homme wrote:
Est-t-il possible de mettre les feuilles d'un projet en mode plein écran? Si
oui comment et surtout quelle est le codage. Merci



C'est à dire sans barre de titre, et en cachant la barre de tâche ?

--
Cordialement,

Jacques.
Avatar
tit-homme
"Jacques" a écrit :

C'est à dire sans barre de titre, et en cachant la barre de tâche ?



Exatement comme pour un diaporama mais pour un programme en Vb
Avatar
Jacques
Bonsoir,

un truc dans ce genre la :

Private Const GWL_STYLE = (-16)
Private Const WS_CAPTION = &HC00000
Private Declare Function GetWindowLong Lib "user32" Alias
"GetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias
"SetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long, ByVal
dwNewLong As Long) As Long

Private Const HWND_TOP = 0
Private Const SWP_SHOWWINDOW = &H40
Private Const SWP_HIDEWINDOW = &H80
Private Declare Function SetWindowPos Lib "user32" (ByVal Hwnd As Long,
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal Y As Long, ByVal
Cx As Long, ByVal Cy As Long, ByVal wFlags As Long) As Long

Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As
Long) As Long

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long


Private Sub Command1_Click()
FullScreen True
End Sub

Private Sub Command2_Click()
FullScreen False
End Sub

Private Sub FullScreen(ByVal bFullScreen As Boolean)
Static Top As Long, Left As Long
Static Width As Long, Height As Long
Dim Cx As Long, Cy As Long
Dim lResult As Long

If Not bFullScreen Then
ViewTaskBar True

' Restaure la barre de titre
lResult = GetWindowLong(Me.Hwnd, GWL_STYLE)
lResult = lResult Or WS_CAPTION
SetWindowLong Me.Hwnd, GWL_STYLE, lResult
SetWindowPos Me.Hwnd, HWND_TOP, Left, Top, Width, Height,
SWP_SHOWWINDOW
Else
' Sauvegarde la taille et la position de la fenetre
Left = Me.Left / Screen.TwipsPerPixelX
Top = Me.Top / Screen.TwipsPerPixelY
Width = Me.Width / Screen.TwipsPerPixelX
Height = Me.Width / Screen.TwipsPerPixelY
' Cache la barre de tache
ViewTaskBar False
' Chache la barre de titre
lResult = GetWindowLong(Me.Hwnd, GWL_STYLE)
lResult = lResult And Not (WS_CAPTION)
SetWindowLong Me.Hwnd, GWL_STYLE, lResult
Me.WindowState = vbMaximized
' Occupe la taille physique de l'ecran
Cx = GetSystemMetrics(SM_CXSCREEN)
Cy = GetSystemMetrics(SM_CYSCREEN)
SetWindowPos Me.Hwnd, HWND_TOP, 0, 0, Cx, Cy, SWP_SHOWWINDOW
End If
End Sub

' Affiche / Eface la barre de taches Windows
' ========================================= Private Sub ViewTaskBar(bShow As Boolean)
Dim lResult As Long

lResult = FindWindow("Shell_traywnd", "")
If lResult Then
If bShow Then
lResult = SetWindowPos(lResult, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
Else
lResult = SetWindowPos(lResult, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
End If
End If
End Sub

tit-homme wrote:


"Jacques" a écrit :


C'est à dire sans barre de titre, et en cachant la barre de tâche ?




Exatement comme pour un diaporama mais pour un programme en Vb




--
Cordialement,

Jacques.
Avatar
Jean-Marc
"tit-homme" a écrit dans le message de
news:


"Jacques" a écrit :

> C'est à dire sans barre de titre, et en cachant la barre de tâche ?
>
Exatement comme pour un diaporama mais pour un programme en Vb



A la conception de la form, tu mets la propriété BoderStyle de la forme à
"0 - None"
puis
Dans le form_load tu fais:
Me.WindowState = vbMaximized

n'oublies pas de placer sur la feuille un moyen de quitter, car tu n'as
alors plus de menu système donc tu ne peux pas quitter autrement que par
code.

--
Jean-marc
"There are only 10 kind of people
those who understand binary and those who don't."