Re: Again: Stringgrid self shiftup: problem circumvented

Posted by Ed on April 13, 2004

In Reply to: Again: Stringgrid self shiftup posted by Ed on April 12, 2004

: This is still the same problem as posted on 26/9/2004.
: I am displaying a deck of cards with a Stringgrid. 4 rows (one row for each suit), 13 columns. Clicking on a card means playing that card.
: But, at runtime, after a click on the lowest row, the system shifts all the rows up by 1. The former top row is now invisible, and former row n is now at n-1. Very annoying. I did not ask the system to do that.
: The shift up seems to happen at the very end of the event handler. The event handler is my own method. It is assigned to the OnSelectcell event of the stringgrid.
: Any idea how to prevent the shift up?

------------------------
13.4.2004:
Apparently the shiftup is related to the height and width of the Grid. I do not understand the relation. E.g., if rows are 20 high and lines beween them have a thickness of 1, then a total height of 85 should suffice. But 87 are necessary. Similarly for the widths. All this is experienced when the Grid is a component of a parent object, e.g. a Frame.
The case can be dismissed, the solution being trial and error.


[ DelphiLand: free Delphi source code, tips, tutorials ]