Scrolling through strings in a stringgrid

Hi i am Peter,

I have a litte problem:

I am working on a program that pings servers, so i use
a stringgrid with 30 servernames. The program scrolls
through the stringgrid to check the servers.

Only the program checks empty cells too!

How can i tell my program to only check the cells
that are filled with text.

I thing the change must be made in the following procedure:

procedure TForm1.GridServersDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
Kleur: TColor;
with (Sender as TStringGrid) do
if gdFixed in State then Kleur := FixedColor
else if IsWaiting then Kleur := Color
else if gdFocused in State then Kleur := clYellow
else if gdSelected in State then Kleur := clLime
else Kleur := Color;
with Canvas do
Brush.Color := Kleur;
Font.Color := clBlack;
if not IsWaiting and (gdFocused in State) then
Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic);
Rect.Left := Rect.Left + Image1.Width +2;
TextOut(Rect.Right - TextWidth(Cells[ACol, ARow]) - 2,
Rect.Top + 2, Cells[ACol, ARow]);




Peter Kiers

I assume that this post is Non-FIRST related.

Team 1111 is located in Edgewater MD, USA, not in the Netherlands.

This Forum is for FIRST Robotics Related discussion.

More about the competition can be found here:

As for help with your dilemma, I can offer none.

Well, kinda a duplicate post (because of the above), but…

(I think that’s Delphi, anyway… don’t know the language… :))

Maybe i made a mistake
Correct me if i’m wrong:

I thought this was a Delphi-forum:

and i could ask a question when i have a problem with my program!


Peter Kiers