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

VBA Access Discussion :

Agrandir fenêtre de parcours de dossier


Sujet :

VBA Access

  1. #1
    Membre habitué
    Profil pro
    Étudiant
    Inscrit en
    Mai 2008
    Messages
    130
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2008
    Messages : 130
    Points : 161
    Points
    161
    Par défaut Agrandir fenêtre de parcours de dossier
    Bonjour a tous

    j'utilise le code voir plus bas

    Pour pouvoir sélectionner un dossier.

    Ma question est la suivante :
    Comment faire pour agrandir la fenêtre de dialogue que se programme ouvre ?

    Merci d'avance

    voici le code
    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
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    Dim Dossier_choisi As String
     
    Private Type BrowseInfo
        hWndOwner As Long
        pIDLRoot As Long
        pszDisplayName As Long
        lpszTitle As Long
        ulFlags As Long
        lpfnCallback As Long
        lParam As Long
        iImage As Long
    End Type
     
    Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long)
    Private Declare Function lstrcat Lib "kernel32" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
    Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
    Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
     
    Private Sub Parcourir()
        Dim Rien As Integer
        Dim Liste As Long
        Dim Resultat As String
        Dim Browse_info As BrowseInfo
        With Browse_info
            ' .hWndOwner = Me.hWnd
            .lpszTitle = lstrcat("Choix du dossier à analyser", "")
            .ulFlags = 1
        End With
        Liste = SHBrowseForFolder(Browse_info)
        If Liste Then
            Resultat = String$(260, 0)
            SHGetPathFromIDList Liste, Resultat
            CoTaskMemFree Liste
            Rien = InStr(Resultat, vbNullChar)
            If Rien Then
                Dossier_choisi = Left$(Resultat, Rien - 1)
                MsgBox "Le dossier choisi est :" & vbNewLine & Dossier_choisi, vbInformation
            End If
        End If
    End Sub
     
    Private Sub ecrire(A_ecrire As String, Optional Gras As Boolean, Optional Couleur As Long)
        Etat.SelStart = Len(Etat)
        Etat.SelBold = Gras
        If Not (IsMissing(Couleur)) Then
            Etat.SelColor = Couleur
          Else
            Etat.SelColor = vbBlack
        End If
        Etat.SelText = A_ecrire & vbNewLine
        Etat.SelBold = False
        Etat.SelColor = vbBlack
    End Sub
     
    Public Function explorer(ByVal Chemin As String)
        On Error Resume Next
        Dim id_1 As Integer
        Dim id_2 As Integer
        Dim id_3 As Integer
        Dim ids() As String
        Dim dossier_courant As String
        If Dir(Chemin, vbDirectory) = "" Then
            Exit Function
        End If
        dossier_courant = Dir(Chemin, vbDirectory)
        Do While dossier_courant <> ""
            If dossier_courant <> "." And dossier_courant <> ".." Then
                If (GetAttr(Chemin & dossier_courant) And vbDirectory) <> 0 Then
                    id_1 = id_1 + 1
                End If
            End If
            dossier_courant = Dir
        Loop
        ReDim ids(id_1)
        dossier_courant = Dir(Chemin, vbDirectory)
        Do While dossier_courant <> ""
            If dossier_courant <> "." And dossier_courant <> ".." Then
                If (GetAttr(Chemin & dossier_courant) And vbDirectory) <> 0 Then
                    id_2 = id_2 + 1
                    ids(id_2) = dossier_courant
                    If Afficher_sous_dossiers.Value <> 0 Then
                        ecrire dossier_courant, True
                    End If
                  Else
                    ecrire dossier_courant
                End If
            End If
            dossier_courant = Dir
        Loop
        For id_3 = 1 To id_1
            If Sous_dossiers.Value <> 0 Then
                explorer Chemin & ids(id_3) & "\"
            End If
        Next
    End Function
     
    Private Sub Parti_Click()
        If Dossier_choisi = "" Then
            MsgBox "Vous devez sélectionner un dossier à analyser.", vbExclamation
            Exit Sub
        End If
        If Right(Dossier_choisi, 1) <> "\" Then
            Dossier_choisi = Dossier_choisi & "\"
        End If
        Parcourir.Enabled = False
        Sous_dossiers.Enabled = False
        Afficher_sous_dossiers.Enabled = False
        Parti.Enabled = False
        Etat.Text = ""
        ecrire "C'est parti dans " & Dossier_choisi, True, vbBlue
        explorer Dossier_choisi
        ecrire "C'est fini !", True, vbBlue
        Parcourir.Enabled = True
        Sous_dossiers.Enabled = True
        Afficher_sous_dossiers.Enabled = True
        Parti.Enabled = True
    End Sub

  2. #2
    Expert éminent sénior
    Avatar de kiki29
    Homme Profil pro
    ex Observeur CGG / Analyste prog.
    Inscrit en
    Juin 2006
    Messages
    6 132
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : ex Observeur CGG / Analyste prog.

    Informations forums :
    Inscription : Juin 2006
    Messages : 6 132
    Points : 11 272
    Points
    11 272
    Par défaut
    Re, en modifiant ton code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    Public Const BIF_NEWDIALOGSTYLE = &H40
     
    .....
     
    Sub Parcourir()
    Dim Rien As Integer
    Dim Liste As Long
    Dim Resultat As String
    Dim Browse_info As BrowseInfo
        With Browse_info
            .ulFlags = BIF_NEWDIALOGSTYLE
            .lpszTitle = lstrcat("Choix du dossier à analyser", "")
        End With
        .....

  3. #3
    Membre habitué
    Profil pro
    Étudiant
    Inscrit en
    Mai 2008
    Messages
    130
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2008
    Messages : 130
    Points : 161
    Points
    161
    Par défaut
    Ouais! C'est ca, Merci KIKI 29
    C'est ce que je cherche

    J'abuse peut être mais tu ne serais pas comment on fait pour initialiser sa postions et sa taille a cette boite de dialogue?

  4. #4
    Expert éminent sénior
    Avatar de kiki29
    Homme Profil pro
    ex Observeur CGG / Analyste prog.
    Inscrit en
    Juin 2006
    Messages
    6 132
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Finistère (Bretagne)

    Informations professionnelles :
    Activité : ex Observeur CGG / Analyste prog.

    Informations forums :
    Inscription : Juin 2006
    Messages : 6 132
    Points : 11 272
    Points
    11 272
    Par défaut
    Salut, voir dans le fichier BrowseforFoilder.zip :
    CenterDialog,BrowseCallBackFunc,BrowseCallBackFuncAddress ansi que les déclarations attenantes

  5. #5
    Membre habitué
    Profil pro
    Étudiant
    Inscrit en
    Mai 2008
    Messages
    130
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2008
    Messages : 130
    Points : 161
    Points
    161
    Par défaut
    Merci
    Grâce a toi , j'ai trouver

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

Discussions similaires

  1. Parcours de dossier
    Par amateurc dans le forum Ada
    Réponses: 5
    Dernier message: 19/06/2008, 22h37
  2. Agrandir fenêtre par la gauche?
    Par Brocoly dans le forum WinDev
    Réponses: 8
    Dernier message: 18/05/2008, 17h33
  3. Droits pour le parcours de dossier
    Par gazelle dans le forum Langage
    Réponses: 2
    Dernier message: 10/06/2007, 18h25
  4. [GUI] Fenêtre pour choix de dossier
    Par RKOCOCO dans le forum Interfaces Graphiques
    Réponses: 2
    Dernier message: 14/05/2007, 10h51
  5. Agrandir fenêtre
    Par Memnoch60 dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 16/03/2006, 23h27

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