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
| Private Sub UserForm_Initialize(position As Integer)
Const GWL_STYLE = (-16)
Const GWL_EXSTYLE = (-20)
Const WS_SIZEBOX = &H40000
Const WS_EX_APPWINDOW = &H40000
Dim hwnd As Long, wLong As Long
Initialisation = True
'ci-dessous : renseigner le nom de la feuille ou se trouve la base de données
Set fl = Worksheets("FichierCentrale")
fl.Cells(1, 1).Select 'Aucune incidence sur les procédure
'Nombre de colonnes possédant une entête
NbreColonnes = fl.Range("B1").SpecialCells(xlCellTypeLastCell).Column
If NbreColonnes > 69 Then NbreColonnes = 69 'Limité du Nbre de Textbox
NoLigne = 2 'initiation de la prémière ligne
Call ScrollBarMax 'Détermine la dernière ligne accessible
Me.ScrollBar1.Value = position
Me.ScrollBar1.Min = 2 'L'entête est sur la ligne 1
Call NomDesLabels 'lit les entêtes de colonnes pour les afficher
DoEvents
wForm = Me.Width: hForm = Me.Height
hwnd = FindWindow(vbNullString, Me.Caption)
wLong = GetWindowLongA(hwnd, GWL_EXSTYLE)
wLong = wLong Or WS_EX_APPWINDOW
SetWindowLong hwnd, GWL_EXSTYLE, wLong
wLong = GetWindowLongA(hwnd, GWL_STYLE)
wLong = wLong Or WS_SIZEBOX
SetWindowLong hwnd, GWL_STYLE, wLong
Call lblResize
Call SaveControlsProperties
End Sub |
Partager