Einzelnen Beitrag anzeigen

Benutzerbild von Piro
Piro

Registriert seit: 14. Jul 2003
Ort: Flintbek
810 Beiträge
 
Delphi XE2 Professional
 
#7

Re: StringGrid + Icon einfügen

  Alt 24. Nov 2004, 16:08
Delphi-Quellcode:
procedure Tfrm_main.sg_systeminfoDrawCell(Sender: TObject; ACol,
  ARow: Integer; Rect: TRect; State: TGridDrawState);
var
 icon : TIcon;
Begin
 icon := TIcon.Create;
 icon.LoadFromFile('D:\Delphi\Delphi 7\SystemUtilities\icon\16main.ico');
 with sg_systeminfo do
 begin
   if ACol = 0 then
     case ARow of
       1: Canvas.Draw(Rect.Left,Rect.Top, icon);
     end;

   if ACol = 1 then
     case ARow of
       1: DrawText(Canvas.handle,PChar(' Betriebssystem'),-1, Rect, DT_SINGLELINE+DT_LEFT+DT_VCENTER);
     end;

   if ACol = 2 then
     case ARow of
       1: DrawText(Canvas.handle,PChar(' '+GetOperatingSystem),-1, Rect, DT_SINGLELINE+DT_LEFT+DT_VCENTER);
     end;
  end;
end;
So funktioniert es aus einer Datei. Aber wie aus der Imageliste?

Sven
  Mit Zitat antworten Zitat