Go to Post This is a risk. Life is full of risks. FIRST is life... therefore, FIRST is full of risks. - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 07-03-2005, 12:56
Peter Kiers Peter Kiers is offline
Registered User
#1111
 
Join Date: Mar 2005
Location: The Netherlands
Posts: 2
Peter Kiers is an unknown quantity at this point
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);
var
Kleur: TColor;
begin
with (Sender as TStringGrid) do
begin
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
begin
Brush.Color := Kleur;
Font.Color := clBlack;
FillRect(Rect);
if not IsWaiting and (gdFocused in State) then
begin
Draw(Rect.Left, Rect.Top, Image1.Picture.Graphic);
Rect.Left := Rect.Left + Image1.Width +2;
end;
TextOut(Rect.Right - TextWidth(Cells[ACol, ARow]) - 2,
Rect.Top + 2, Cells[ACol, ARow]);

end;
end;
end;


Greetings,

Peter Kiers
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:59.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi