Bonjour,

J'utilise le composant PDJRotoLabel (c'est un freeware) pour afficher un texte en vertical dans une celulle de tStringGrid.
Ca marche bien... Sauf quand le contenu est plus grand que le contenant (quand il y a un ascenceur en bas, quoi).

Je charge mes elements comme ceci:
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
  while not eof do begin
    sgOption.ColCount := sgOption.ColCount + 1;
    sgOption.ColWidths[sgOption.ColCount-1] := 21;
    sgOption.Objects[sgOption.ColCount-1,0] := TObject(fieldbyname('id_colonne').AsInteger);
    //Les roto Label
    sTmp := fieldbyname('desi').AsString;
    myRotoLabel := TPDJRotoLabel.Create(self);
    myRotoLabel.Angle := ag90;
    myRotoLabel.Font.Color := clBlack;
    myRotoLabel.Font.Name := 'Microsoft Sans Serif';
    myRotoLabel.Font.Size := 8;
    myRotoLabel.Transparent := True;
    myRotoLabel.Caption := sTmp;
    myRotoLabel.Height := trunc(sgOption.Canvas.TextWidth(sTmp)*rtRatio);
    hMax := max(hMax, myRotoLabel.Height);
    myRotoLabel.Width := 21 ;
    myRotoLabel.Parent := sgOption; //.Parent;
    myRotoLabel.Left := sgOption.CellRect(sgOption.ColCount-1,0).Left;
    myRotoLabel.Top := sgOption.CellRect(sgOption.ColCount-1,0).Top+sgOption.RowHeights[0]-myRotoLabel.Height;
    sgOption.Objects[sgOption.ColCount-1, 1] := myRotoLabel;
    next;
  end;
Et dans le sgOptionDrawCell, j'ai fait ceci:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
      //On ajuste le RotoLabel
      sgOption.Canvas.FillRect(Rect);
      (sgOption.Objects[ACol,1] as TPDJRotoLabel).Width := Rect.Right - rect.Left  ;
      (sgOption.Objects[ACol,1] as TPDJRotoLabel).Left :=  Rect.Left;
Est ce que quelqu'un a une idée ?

Merci d'avance.