towney
Messages postés26Date d'inscriptionlundi 24 septembre 2007StatutMembreDernière intervention29 janvier 2008
-
25 janv. 2008 à 15:25
towney
Messages postés26Date d'inscriptionlundi 24 septembre 2007StatutMembreDernière intervention29 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.
bigfish_le vrai
Messages postés1835Date d'inscriptionvendredi 13 mai 2005StatutMembreDernière intervention20 novembre 201315 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
bigfish_le vrai
Messages postés1835Date d'inscriptionvendredi 13 mai 2005StatutMembreDernière intervention20 novembre 201315 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 ^^