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

VB 6 et antérieur Discussion :

Texte vertical flexgrid


Sujet :

VB 6 et antérieur

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 14
    Points : 10
    Points
    10
    Par défaut Texte vertical flexgrid
    Bonjour,

    J'ai inséré un flexgrid dans mon programme. Ce flexgrid s'étend tout seul en fonction des résultats d'une requête SQL.
    Bref, pour en venir au thème, quand j'ai pas beaucoup de résultat c'est bien.
    Mais lorsque que j'en ai beaucoup plus, le texte dans les cases agrandissent considérablement mon flexgrid.
    Cet alors que je voudrais savoir s'il est possible d'écrire verticalement dans les case d'une flexgrid, d'une manière ou d'une autre ?

    Merci de vos réponses...

    Albat90

  2. #2
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 14
    Points : 10
    Points
    10
    Par défaut
    Bonjour,

    Bon j'avance dans ma recherche. J'ai demander à ma prof et d'après elle, c'est infaisable.
    Je trouve ça assez étonnant mais bon.
    Je reste quand même sur une possibilité qu'elle ne connaitrait pas

    Si vous avez des solutions ou des lueurs de solutions, n'hésiter pas à poster

    Albat90

  3. #3
    Expert confirmé
    Avatar de zazaraignée
    Profil pro
    Étudiant
    Inscrit en
    Février 2004
    Messages
    3 174
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2004
    Messages : 3 174
    Points : 4 085
    Points
    4 085
    Par défaut
    Salut

    Si tu mets la propriétés WordWrap de ton FlexGrid à True, tu pourras ensuite forcer une largeur maximale avec la propriété ColWidth. Le texte devrait s'ajuster. Si la hauteur de la cellule ne s'ajuste pas, il y a la propriété RowHeight.

  4. #4
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 14
    Points : 10
    Points
    10
    Par défaut
    Bonjour j'ai tester ta solution mais....

    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
     
    msftableau.col = 1
    msftableau.Row = 0
    msftableau.Text = "Faute/obstacles"
    msftableau.col = 2
    msftableau.Text = "Barre"
    msftableau.col = 3
    msftableau.Text = "Refus"
    msftableau.col = 4
    msftableau.Text = "Chute"
    msftableau.col = 5
    msftableau.Text = "Désobéïssance"
    msftableau.col = 0
    msftableau.Row = 1
    msftableau.Text = "1"
    msftableau.Row = 2
    msftableau.Text = "2"
    msftableau.Row = 3
    msftableau.Text = "3"
    msftableau.Row = 4
    msftableau.Text = "4"
     
    msftableau.WordWrap = True
    msftableau.RowHeight(0) = 1000
    For i = 0 To 5
    msftableau.ColWidth(i) = 300
    Next i
    Bon alors, je me retrouve avec des mots coupé a deux lettre mais rien ne reviens à la ligne :s
    Et aucun texte n'a changé d'orientation.
    Néanmoins, je vais continuer à faire des test

    Merci quand même

    Albat90

  5. #5
    Expert éminent sénior
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 078
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 078
    Points : 17 048
    Points
    17 048
    Par défaut
    Si tu veux un affichage sur plusieurs lignes d'un mot, separs chaque lettre par un espace, mais bonjour la hauteur de ta premiere ligne .
    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
    msftableau.Font = "courrier"
    msftableau.TextMatrix(0, 1) = "F a u t e / o b s t a c l e s"
    msftableau.TextMatrix(0, 2) = "B a r r e"
    msftableau.TextMatrix(0, 3) = "R e f u s"
    msftableau.TextMatrix(0, 4) = "C h u t e"
    msftableau.TextMatrix(0, 5) = "D é s o b é ï s s a n c e"
     
    msftableau.TextMatrix(1, 1) = "1"
    msftableau.TextMatrix(2, 1) = "2"
    msftableau.TextMatrix(3, 1) = "3"
    msftableau.TextMatrix(4, 1) = "4"
    Dim I As Integer
    msftableau.WordWrap = True
    msftableau.RowHeight(0) = 3180
    For I = 0 To 5
    msftableau.ColWidth(I) = 225
    Next I
    pourquoi pas, pour remercier, un pour celui/ceux qui vous ont dépannés.
    saut de ligne
    OOOOOOOOO👉 → → Ma page perso sur DVP ← ← 👈

  6. #6
    Expert éminent sénior
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 078
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 078
    Points : 17 048
    Points
    17 048
    Par défaut
    écrire verticalement dans les case d'une flexgrid,
    J'ai demander à ma prof et d'après elle, c'est infaisable
    Prof d'informatique, programmation ?
    Tu vas pouvoir lui démontrer le contraire.
    Sur un Form, 1 Commandbutton, 2 PictureBox PictSource et PictResult, 1 Label LabFormats et un MSFlexGrid msftableau
    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
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    Option Explicit
    'pour rotation de l'affichage du curseur
    Private Type BITMAP
        bmType As Long
        bmWidth As Long
        bmHeight As Long
        bmWidthBytes As Long
        bmPlanes As Integer
        bmBitsPixel As Integer
        bmBits As Long
    End Type
    Private Type BITMAPINFOHEADER
        biSize As Long
        biWidth As Long
        biHeight As Long
        biPlanes As Integer
        biBitCount As Integer
        biCompression As Long
        biSizeImage As Long
        biXPelsPerMeter As Long
        biYPelsPerMeter As Long
        biClrUsed As Long
        biClrImportant As Long
    End Type
    Private Type RGBQUAD
        rgbBlue As Byte
        rgbGreen As Byte
        rgbRed As Byte
        rgbReserved As Byte
    End Type
    Private Type BITMAPINFO
        bmiHeader As BITMAPINFOHEADER
        bmiColors As RGBQUAD
    End Type
    Private Declare Function SetDIBits Lib "gdi32" ( _
        ByVal hdc As Long, _
        ByVal hBitmap As Long, _
        ByVal nStartScan As Long, _
        ByVal nNumScans As Long, _
        lpBits As Any, _
        lpBI As BITMAPINFO, _
        ByVal wUsage As Long) As Long
    Private Declare Function GetDIBits Lib "gdi32" ( _
        ByVal aHDC As Long, _
        ByVal hBitmap As Long, _
        ByVal nStartScan As Long, _
        ByVal nNumScans As Long, _
        lpBits As Any, _
        lpBI As BITMAPINFO, _
        ByVal wUsage As Long) As Long
    ' fin pour rotation de l'affichage
     
    Dim T As Integer, U As Integer
    Dim MotsTitre(4) As String
    Private Sub Form_Load()
    Me.Height = 3990: Me.Width = 5115
    Command1.Move 180, 60, 1755, 345: Command1.Caption = "Go"
    LabFormats.Move 2070, 120: LabFormats.BorderStyle = 0: LabFormats.AutoSize = True
    msftableau.Appearance = flexFlat
    msftableau.Move 120, 480, 4755, 3015
    PictSource.Appearance = 0: PictSource.ScaleMode = vbPixels: PictSource.AutoRedraw = True
    PictSource.Move 120, 3570
    PictResult.Appearance = 0: PictResult.ScaleMode = vbPixels: PictResult.AutoRedraw = True
    PictResult.Move 120, 3960
     
    LabFormats.Visible = False: PictSource.Visible = False: PictResult.Visible = False
     
    MotsTitre(0) = "Faute/obstacles"
    MotsTitre(1) = "Barre"
    MotsTitre(2) = "Refus"
    MotsTitre(3) = "Chute"
    MotsTitre(4) = "Désobéïssance"
     
    msftableau.Rows = 5: msftableau.Cols = 6
    LabFormats.FontName = msftableau.Font
    LabFormats.FontSize = msftableau.Font.Size
    LabFormats.FontBold = True
    'LabFormats.FontBold = False
    PictSource.Height = LabFormats.Height
    PictSource.FontName = msftableau.Font
    PictSource.FontSize = msftableau.Font.Size
    PictSource.FontBold = LabFormats.FontBold
    PictSource.ForeColor = msftableau.ForeColorFixed
    PictSource.BackColor = msftableau.BackColorFixed
    End Sub
     
    Private Sub Command1_Click()
    Dim Maxlarge As Integer
    Maxlarge = 0
    For T = 0 To 4
     LabFormats = MotsTitre(0)
     If LabFormats.Width > Maxlarge Then Maxlarge = LabFormats.Width
    Next T
    msftableau.RowHeight(0) = Maxlarge + 90
     
    msftableau.Row = 0
    For T = 0 To 5
     msftableau.ColWidth(T) = LabFormats.Height + 390 
    Next T
     
    For T = 1 To 5
     LabFormats = MotsTitre(T - 1)
     PictSource.Width = LabFormats.Width + 90
     PictSource.Cls: PictSource.CurrentX = 2: PictSource.Print MotsTitre(T - 1)
     PivoteR "D" 'ou G au choix
     msftableau.Col = T
     msftableau.CellPictureAlignment = flexAlignCenterBottom ' ou flexAlignCenterTop ou ....
     Set msftableau.CellPicture = PictResult.Image 'place l'image
    Next T
    End Sub
    Private Sub PivoteR(SenS As String)
    Dim Buffer() As RGBQUAD, Result() As RGBQUAD
    Dim MeWidth As Long, MeHeight As Long
    Dim BMPINFO As BITMAPINFO
    Dim BMPINFOH As BITMAPINFOHEADER
    Dim X As Long, Y As Long, XX As Long, YY As Long
     
    MeWidth = PictSource.ScaleWidth: MeHeight = PictSource.ScaleHeight
     
    ReDim Buffer(0 To MeWidth - 1, 0 To MeHeight - 1)
    With BMPINFOH
     .biBitCount = 32
     .biHeight = MeHeight: .biWidth = MeWidth
     .biPlanes = 1: .biSize = Len(BMPINFOH)
    End With
    BMPINFO.bmiHeader = BMPINFOH
    GetDIBits PictSource.hdc, PictSource.Image.Handle, 0, MeHeight, Buffer(0, 0), BMPINFO, 0
    X = UBound(Buffer, 1): Y = UBound(Buffer, 2)
    ReDim Result(0 To Y, 0 To X)
     
    If SenS = "G" Then 'rotation 90° a gauche
     For XX = 0 To X
      For YY = 0 To Y: Result(Y - YY, XX) = Buffer(XX, YY): Next YY
     Next XX
     Else 'rotation 90° a droite
     For XX = 0 To X
      For YY = 0 To Y: Result(YY, X - XX) = Buffer(XX, YY): Next YY
     Next XX
    End If
    PictResult.Width = PictSource.Height: PictResult.Height = PictSource.Width
    With BMPINFOH
     .biBitCount = 32
     .biHeight = MeWidth: .biWidth = MeHeight
     .biPlanes = 1: .biSize = Len(BMPINFOH)
    End With
    BMPINFO.bmiHeader = BMPINFOH
    PictResult.Cls
    SetDIBits PictResult.hdc, PictResult.Image.Handle, 0, MeWidth, Result(0, 0), BMPINFO, 0
    End Sub
    Maintenant , vas chercher ta prof, et lance ce projet.
    pourquoi pas, pour remercier, un pour celui/ceux qui vous ont dépannés.
    saut de ligne
    OOOOOOOOO👉 → → Ma page perso sur DVP ← ← 👈

  7. #7
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 14
    Points : 10
    Points
    10
    Par défaut
    Merci beaucoup de ta réponse

    En effet, Bluffé la prof (comme quoi que... )
    merci beaucoup de ton code...
    Donc si je comprend bien, tu utilise des images pour afficher verticalement...
    Cependant, est-il possible d'utiliser les données vertical pour s'en servir de données?

    Albat90

  8. #8
    Expert éminent sénior
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 078
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 078
    Points : 17 048
    Points
    17 048
    Par défaut
    est-il possible d'utiliser les données vertical pour s'en servir de données?
    Malhereusement non.
    Le beurre, l'argent du beurre, et la femme du laitier aussi ,
    allez, bon d'accord, en allant dans ma page de contribution (dans ma signature plus bas) tu trouveras un zip à la ligne Demo d'un MSHFLEXGRID avec cellules Checked et textes.
    Charge le, tu verras la solution.
    pourquoi pas, pour remercier, un pour celui/ceux qui vous ont dépannés.
    saut de ligne
    OOOOOOOOO👉 → → Ma page perso sur DVP ← ← 👈

  9. #9
    Membre à l'essai
    Profil pro
    Inscrit en
    Février 2007
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 14
    Points : 10
    Points
    10
    Par défaut
    Merci, je regarde ton projet avec attention.
    J'ai mon idée pour utiliser le texte vertical.
    Je n'ai cas remplir un tableau du style var(i) qui me permettrais de savoir a quelle colonne est marqué quoi ^^

    Merci pour vos réponse

    Albat90

Discussions similaires

  1. Pb de formatage de texte... Vertical, inversé...
    Par Grammaton dans le forum Access
    Réponses: 4
    Dernier message: 01/03/2007, 13h54
  2. [Etat] Texte Vertical
    Par Lejohnn dans le forum IHM
    Réponses: 4
    Dernier message: 06/12/2005, 15h46
  3. Texte vertical
    Par Noun dans le forum OpenGL
    Réponses: 1
    Dernier message: 01/06/2005, 17h13
  4. [C#] Affichage de texte vertical...
    Par AntiSAL dans le forum Windows Forms
    Réponses: 6
    Dernier message: 10/06/2004, 14h46
  5. Canvas et Texte vertical
    Par ulysse66x dans le forum Composants VCL
    Réponses: 8
    Dernier message: 01/02/2004, 16h46

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