AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Gauge in Stringgrid

Ein Thema von jolomino · begonnen am 6. Feb 2005 · letzter Beitrag vom 6. Feb 2005
 
jolomino

Registriert seit: 19. Jan 2005
34 Beiträge
 
#3

Re: Gauge in Stringgrid

  Alt 6. Feb 2005, 21:55
so erstmal danke und ich habs mal probiert, aber die gauge wird übers stringgrid gelagert, also links oben über 4 zellen und 1,5 spalten

Delphi-Quellcode:
unit Unit6;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Gauges, Grids;

type
  TForm6 = class(TForm)
    StringGrid1: TStringGrid;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form6: TForm6;

implementation

{$R *.dfm}

procedure TForm6.Button1Click(Sender: TObject);
var mGauge: TGauge;
begin
mGauge := TGauge.Create(Stringgrid1);
mGauge.Parent := stringgrid1;
mGauge.Progress := 48;
stringgrid1.Objects[2,2] := mGauge;
end;

procedure TForm6.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
  var tmpGauge : TGauge;
begin
if (Acol = 2) AND (Arow = 2) then
begin
  if stringgrid1.Objects[2,2] <> nil then
  begin
   tmpGauge := (stringgrid1.Objects[2,2] as TGauge);
   with tmpGauge do
   begin
    Left := Rect.Left;
    Top := Rect.Top;
    Width := Rect.Right - Rect.Left;
    Height := Rect.Bottom - Rect.Top;
   end;
  end;
end;
end;

end.
müsste doch so passen oder?

gruss jolomino
  Mit Zitat antworten Zitat
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:52 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz