Integer Posted January 14, 2011 Report Share Posted January 14, 2011 Witam. Przeglądałem zdarzenia z komponentu Stringgrid, ale nie znalazłem, być może i w Google wklepywałem niewłaściwe hasła dlatego proszę o podpowiedź lub nakierowanie. Załóżmy że mam 10 kolumn i 200 wierszy w stingirdzie i przesuwam suwakiem na np. środek tabeli czyli mam w lewym górnym rogu col=3, row=40, i np wyświetlane są 4 kolumny i 10 wierszy; chodzi mi o informację jakie komórki w danej chwili są wyświetlane bez konieczności klikania myszką. Link to comment Share on other sites More sharing options...
tohimon Posted January 16, 2011 Report Share Posted January 16, 2011 Witam. W zdarzeniu DrawCell StrinGrida wpisz to co poniżej. procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var xLeft, yTop, xRight, yBottom: integer; begin xLeft := StringGrid1.LeftCol; xRight := StringGrid1.VisibleColCount + StringGrid1.LeftCol - 1; yTop := StringGrid1.TopRow; yBottom := StringGrid1.VisibleRowCount + StringGrid1.TopRow - 1; Form1.Caption := IntToStr(xLeft) + ' ' + IntToStr(yTop) + ' ' + IntToStr(xRight) + ' ' + IntToStr(yBottom); end; Mam nadzieję, że o to chodziło Pozdrawiam Link to comment Share on other sites More sharing options...
Integer Posted January 25, 2011 Author Report Share Posted January 25, 2011 Witam. Tak dokładnie o to chodziło, stokrotne dzięki. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.