سلام
چطور میشه رنگ یک خانه از stringride رو عوض کرد نه همشو
ممنون میشم راهنمایی کنین
Printable View
سلام
چطور میشه رنگ یک خانه از stringride رو عوض کرد نه همشو
ممنون میشم راهنمایی کنین
ویژگی DefaultDrawing مربوط به StringGrid رو False کنید و کد زیر و در OnDrawCell اون بنویسید:
if (ACol = 3) and (ARow = 3) then
begin
TStringGrid(Sender).Canvas.Brush.Color := clBlack;
TStringGrid(Sender).Canvas.Font.Color := clYellow;
end
else
begin
TStringGrid(Sender).Canvas.Brush.Color := clWhite;
TStringGrid(Sender).Canvas.Font.Color := clBlack;
end;
TStringGrid(Sender).Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, TStringGrid(Sender).Cells[ACol, ARow]);
برای اینکه بتونی نتیجه رو بهتر ببینی، سعی کن تو سطر و ستون 3 و 3 مقدار Test رو وارد کنی.