This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

TElXTree with TElXCellCheckBox.Create(): Centering in Cell?

edited May 2013 in LMD ElPack
Is it possible centre the TElXCellCheckBox in the cell.

I have tried using left justification for the caption and adding some spaces to simulate it, but the checkbox disappears.

Thanks.
Raymond

Comments

  • edited May 2013
    Hi Raymond,

    Use code like in this snippet: 

    with ElXTreeControls do
          for i:=0 to Items.Count-1 do
          begin
            Items[i].Cells[c-1].UseOwnStyle := true;
            Items[i].Cells[c-1].Style.Control := TElXCellCheckBox.Create;
            TElXCellCheckBox(Items[i].Cells[c-1].Style.Control).Alignment := taCenter;
            Items[i].Cells[c-1].Text :=  '';
            Items[i].Cells[c-1].Control.OnClick := CellCBClicked;
            (Items[i].Cells[c-1].Control as TElXCellCheckBox).AllowGrayed := true;
          end;
Sign In or Register to comment.