Masquer barre userform

Résolu
towney Messages postés 26 Date d'inscription lundi 24 septembre 2007 Statut Membre Dernière intervention 29 janvier 2008 - 25 janv. 2008 à 15:25
towney Messages postés 26 Date d'inscription lundi 24 septembre 2007 Statut Membre Dernière intervention 29 janvier 2008 - 25 janv. 2008 à 16:03
Bonjour à tous.

Je voulais savoir si il est possible marquer la barre bleu au dessus d'un userform et comment. J'aimerai créer une sorte de menu intégré à mon classeur sans que l'on voit que c'est une form.

Merci d'avance

el perdido...

6 réponses

bigfish_le vrai Messages postés 1835 Date d'inscription vendredi 13 mai 2005 Statut Membre Dernière intervention 20 novembre 2013 15
25 janv. 2008 à 15:58
decidememt je commence mal la journée . Il manque un end sub a la fin je remet le code en entier:

Option Explicit
Private Declare
Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName
As String, ByVal lpWindowName As String) As Long
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 Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long

Private Sub UserForm_Initialize()
    Dim hwnd As Long, Style As Long
    hwnd = FindWindow(vbNullString, Me.Caption)
    Style = GetWindowLong(hwnd, -16) And Not &HC00000
    SetWindowLong hwnd, -16, Style
    DrawMenuBar hwnd
End Sub

Vala, cette fois tout y est... enfin je crois

A+
3
bigfish_le vrai Messages postés 1835 Date d'inscription vendredi 13 mai 2005 Statut Membre Dernière intervention 20 novembre 2013 15
25 janv. 2008 à 15:50
Salut,

dans le code de ton userform tu ajoute ce qui suit :

Option Explicit
Public QuelObjet As String
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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 Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long

Private Sub UserForm_Initialize()
Dim hwnd As Long, Style As Long

hwnd = FindWindow(vbNullString, Me.Caption)
Style = GetWindowLong(hwnd, -16) And Not &HC00000
SetWindowLong hwnd, -16, Style
DrawMenuBar hwnd

Normalement ca marche mais avec toi je suis plus sur de rien ^^

A+
0
bigfish_le vrai Messages postés 1835 Date d'inscription vendredi 13 mai 2005 Statut Membre Dernière intervention 20 novembre 2013 15
25 janv. 2008 à 15:51
...
la ligne : Public QuelObjet As String tu peux l'enlever, elle ne sert a rien

A+
0
towney Messages postés 26 Date d'inscription lundi 24 septembre 2007 Statut Membre Dernière intervention 29 janvier 2008
25 janv. 2008 à 16:00
el perdido...
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
towney Messages postés 26 Date d'inscription lundi 24 septembre 2007 Statut Membre Dernière intervention 29 janvier 2008
25 janv. 2008 à 16:00
el perdido...
0
towney Messages postés 26 Date d'inscription lundi 24 septembre 2007 Statut Membre Dernière intervention 29 janvier 2008
25 janv. 2008 à 16:03
Ah deux post arrivés sans contenu étrange.

Moi non plus je ne suis plus sur de rien mon appli devient de jour en jour le calvaire de mes neurones

Mais la sucessfull du premier coup merci beaucoup bigfish!

el perdido...
0
Rejoignez-nous