Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by EDCAMD

  1. EDCAMD

    Color String Grid rows based on condition

    Okay now you can chortle. Now I have got the Left and Top the correct way around it looks good. Thanks everyone, got there in the end. I'll now add the TextHeight/Width adjustments and remove the constants as suggested. I still say some of the affects caused by the inaccurate X,Y...
  2. EDCAMD

    Color String Grid rows based on condition

    Okay, I have tried changing the code along the lines Andrew (Hamps) suggests and its different. I do now get text in cells when I scroll down but not in all cells. I am guessing the simple Top+4 and Left+4 needs tweaking so I'll look at the definitions for these values and tweak away! Andy
  3. EDCAMD

    Color String Grid rows based on condition

    Okay, I understand that BUT that does not explain why Text gets written successfully sometimes when I scroll up quickly but not when slowly. I mean here for a cell where it once displayed successfully it then doesn't show text! Anyway I'll try the alteration becuase it is clearly simply and...
  4. EDCAMD

    Color String Grid rows based on condition

    The Grid has 101 rows and on first showing it is as expected but you scroll down and there is no text in the rows that were not initially visible but the cells have been coloured as expected. Scroll back up and sometimes you get all the text, others only some of it! I have tried it with...
  5. EDCAMD

    Color String Grid rows based on condition

    I have written a simple single form exmaple and am convinced the problem is related to the scrolling. ANyway here is the DrawCell procedure: procedure TTestStringGrids.StringGridDrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var X, Y : integer...
  6. EDCAMD

    Color String Grid rows based on condition

    Thaks for your persistance. I understand what you say but it does not explain why when the cells are visiblt the FillRect works but not the TextRect for the same cell. I will double check my logic that works out how a cell is to be painted. It is just that it seems to correctly work out, for...
  7. EDCAMD

    Color String Grid rows based on condition

    In my DrawGrid event handler it paints each cell's canvas by setting the Brush.Color and then using Canvas.FillRect to colour the cell and followed by setting the Font.Color and calling Canvas.TextRect to add text. This works fine for all visible cells but the text isn't painted on the cells...
  8. EDCAMD

    Color String Grid rows based on condition

    I am using the StringGridDrawCell to do the Canvas painting. The colouring of the cells works fine all the way through the Grid down into the cells not visible but the TextRect written text does not show up on the non visible cells. I do still have stuff in the FormShow to fill the cells which...
  9. EDCAMD

    Color String Grid rows based on condition

    Great, I have used similar to colour rows in a String Grid but when there is a scroll bar on the Grid the Text put into Cells not visible does not get added. I am guessing I need to add something to the scroll event handler to redraw the text in the Cells newly visible? DOes that sound right...

Part and Inventory Search

Back
Top