IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Forms Discussion :

Mettre forme en plein écran


Sujet :

Windows Forms

  1. #1
    Membre habitué Avatar de benito9253
    Homme Profil pro
    Inscrit en
    Août 2009
    Messages
    205
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Août 2009
    Messages : 205
    Points : 196
    Points
    196
    Par défaut Mettre forme en plein écran
    Bonjour,
    Ca fait pas mal de temps que je cherche comment mettre une forme en plein écran. J'ai trouvé pas mal de solution qui permettent cela mais a chaque mais on voit toujours la barre des tâche. Du coup j'ai essayé en la masquant et ca me fait toujours un espace vide en bas de l'écran.

    Quelqu'un connaitrait il un moyen d'afficher une forme sur la totalité de l'écran?

    Merci d'avance pour les réponse

    PS: Pour l'instant j'utilise ce code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
            'je fais appel a une fonction pour cacher le barre des taches dont 
            'je n'ai pas mis le code ici
            CacherBarreTacheWindows()
            TopMost = True
            WindowState = FormWindowState.Maximized
            FormBorderStyle = Windows.Forms.FormBorderStyle.None

  2. #2
    Membre confirmé Avatar de Redouane
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    435
    Détails du profil
    Informations personnelles :
    Âge : 45
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Octobre 2003
    Messages : 435
    Points : 569
    Points
    569
    Par défaut
    Bonjour,

    j'espère que cet article va t'aider :

    http://www.codeproject.com/KB/cs/Ful...DotNetApp.aspx

    Bonne courage
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Redouane me = new Redouane();
    if (me.Connect())
        me.ShareInformations();

  3. #3
    Membre habitué Avatar de benito9253
    Homme Profil pro
    Inscrit en
    Août 2009
    Messages
    205
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Août 2009
    Messages : 205
    Points : 196
    Points
    196
    Par défaut
    bon j'ai un peu de mal avec l'anglais mais je vais m'accrocher
    en tout cas c'est exactement ce que je cherchais

    merci beaucoup pour ton aide!

  4. #4
    Membre habitué Avatar de benito9253
    Homme Profil pro
    Inscrit en
    Août 2009
    Messages
    205
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Août 2009
    Messages : 205
    Points : 196
    Points
    196
    Par défaut
    comme le site proposé plus haut était écrit en C#.Net j'ai chercher l'équivalent en VB.Net:
    http://www.codeproject.com/KB/vb/vb....creenForm.aspx

    Au final ca donne ca:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    'Il faut insérer trois bouttons:
    'button1 -> fermer l'application
    'button2 -> réduire la fenetre
    'button3 -> passer en plein écran
     
    Public Class Form1
     
        Public Declare Function SetWindowPos Lib "user32.dll" Alias "SetWindowPos" (ByVal hWnd As IntPtr, ByVal hWndIntertAfter As IntPtr, ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As Integer) As Boolean
        Private Declare Function GetSystemMetrics Lib "user32.dll" Alias "GetSystemMetrics" (ByVal Which As Integer) As Integer
     
        Private Const SM_CXSCREEN As Integer = 0
        Private Const SM_CYSCREEN As Integer = 1
        Public Shared HWND_TOP As IntPtr = IntPtr.Zero
        Public Const SWP_SHOWWINDOW As Integer = 64
     
        Public ReadOnly Property ScreenX() As Integer
            Get
                Return GetSystemMetrics(SM_CXSCREEN)
            End Get
        End Property
     
     
        Public ReadOnly Property ScreenY() As Integer
            Get
                Return GetSystemMetrics(SM_CYSCREEN)
            End Get
        End Property
     
     
        Public Sub FullScreen(ByVal frm As Form, ByVal boolTopOptional As Boolean)
     
            frm.WindowState = FormWindowState.Maximized
            frm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
            Me.TopMost = boolTopOptional
            SetWindowPos(frm.Handle, HWND_TOP, 0, 0, ScreenX, ScreenY, SWP_SHOWWINDOW)
     
        End Sub
     
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Application.Exit()
        End Sub
     
        Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
            FullScreen(Me, True)
        End Sub
     
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            TopMost = False
            WindowState = FormWindowState.Normal
            FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
        End Sub
    End Class
     
    Public Class classFullScreen
        Dim varScreen As Screen
        Dim intWidth As Integer = Screen.PrimaryScreen.Bounds.Width
        Dim intHeight As Integer = Screen.PrimaryScreen.Bounds.Height
        Dim intTop As Integer = 0
        Dim intLeft As Integer = 0
        Dim intX As Integer = 0
        Dim intY As Integer = 0
     
        Public Function FullscreenTheForm(ByVal frm As Form)
            frm.Top = intTop
            frm.Left = intLeft
            frm.Width = intWidth + 40
            frm.Height = intHeight
            frm.FormBorderStyle = FormBorderStyle.None
     
            Return 0
        End Function
    End Class

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [VB.NET] Form en plein écran ?
    Par vynce dans le forum Windows Forms
    Réponses: 9
    Dernier message: 09/01/2013, 15h41
  2. Ajuster des composants dans une Form en plein écran
    Par jalalnet dans le forum Windows Forms
    Réponses: 2
    Dernier message: 06/06/2011, 10h15
  3. Cherche comment mettre une forme en plein écran
    Par lou_delphdev dans le forum Débuter
    Réponses: 10
    Dernier message: 17/04/2011, 23h28
  4. forms en plein écran
    Par hichcasa dans le forum Forms
    Réponses: 1
    Dernier message: 05/03/2009, 13h25
  5. Page de traitement de form en plein écran
    Par renaud26 dans le forum Général JavaScript
    Réponses: 12
    Dernier message: 26/04/2007, 15h27

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo