Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

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

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

  • 2 Comments sorted by Votes Date Added
  • edited May 2013 Posts: 0 Accepted Answer Vote Up0Vote Down
    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.