Hello,
I have a TAdvStringGrid with inplace editors and custom
cell borders. When the editor shows, the right and bottom cell borders
disappear (it seems like the editor box is drawn over the cell and positioned 1px right and lower than necessary). When the cell gets focus the blue area and dotted border are 1px lower too.
cell borders. When the editor shows, the right and bottom cell borders
disappear (it seems like the editor box is drawn over the cell and positioned 1px right and lower than necessary). When the cell gets focus the blue area and dotted border are 1px lower too.
Below is my code
AdvStringGrid1.Options:=[goEditing];
AdvStringGrid1.OnGetCellBorder:=Form1GetCellBorder;
AdvStringGrid1.OnGetCellBorderProp:=Form1GetCellBorderProp;
AdvStringGrid1.OnGetCellBorderProp:=Form1GetCellBorderProp;
procedure TForm1.Form1GetCellBorder(Sender: TObject; ARow, ACol: Integer;
APen: TPen; var Borders: TCellBorders);
begin
Borders:=[cbLeft,cbRight,cbTop,cbBottom];
end;
procedure TForm1.Form1GetCellBorderProp(Sender: TObject; ARow, ACol: Integer;
LeftPen, TopPen, RightPen, BottomPen: TPen);
begin
LeftPen.Color:=clBlack;
LeftPen.Style:=TPenStyle.psSolid;
LeftPen.Width:=1;
RightPen.Color:=clBlack;
RightPen.Style:=TPenStyle.psSolid;
RightPen.Width:=1;
TopPen.Color:=clBlack;
TopPen.Style:=TPenStyle.psSolid;
TopPen.Width:=1;
BottomPen.Color:=clBlack;
BottomPen.Style:=TPenStyle.psSolid;
BottomPen.Width:=1;
end;