Dazu habe ich versucht
Code: Alles auswählen
StringGrid1.Selection := TGridRect(Rect(1,1,2,2));
Code: Alles auswählen
planunit.pas(683,44) Fatal: Syntax error, ")" expected but "," found
Laz 1.8.2/32Bit auf Win10
Code: Alles auswählen
StringGrid1.Selection := TGridRect(Rect(1,1,2,2));
Code: Alles auswählen
planunit.pas(683,44) Fatal: Syntax error, ")" expected but "," found
Code: Alles auswählen
StringGrid1.Selection := Rect(1, 1, 2, 2);
Stimmt, bei mir geht es auch mit TGridRect.Bei mir geht's. Du hast wahrscheinlich die Windows-Unit in der "uses"-Zeile, und zwar NACH Classes.
Diese Umwandlung ist unnötig, da TGridRect nur ein Alias für TRect ist. Für den Fall dass es mal geändert wird, nützt dir die Typumwandlung allerdings auch nichts.Mathias hat geschrieben:Macht es überhaupt Sinnmit TGridRect eine Typenumwandlung durchzuführen ?
Code: Alles auswählen
if(aRow >=1) and (aCol >=2) then
DrawText(StringGrid1.Canvas.Handle, PChar('|'), StrLen(PChar('|')), aRect, DT_CENTER);
Code: Alles auswählen
StringGrid1.Canvas.TextOut(x, y, s)
Code: Alles auswählen
var
ts: TTextStyle;
begin
ts := StringGrid1.Canvas.Textstyle;
ts.Alignment := taCenter; // horizontale zentrierung
ts.Layout := tlCenter; // vertikale Zentrierung
StringGrid1.Canvas.TextRect(ARect, ARect.Left, ARect.Top, '|', ts);
end;