SalarSoftwares logo

خوش آمدید. در این سایت می توانید ابزارهای دلفی و نرم افزارها را دریافت کنید.

صفحه اصلی | مقالات | سوال و جواب | Downloads | Beeper help | جستجو | تصاویر برنامه ها | تبلیغات | تماس با ما | وبلاگ شخصی

رنگ آميزي يك TDBGrid

procedure TForm1.ColorGrid(dbgIn: TDBGrid; qryIn: TQuery; const Rect: TRect;
  DataCol: Integer; Column: TColumn;
  State: TGridDrawState);
var 
  iValue: LongInt;
begin
  // color only the first field
  // nur erstes Feld einfärben
  if (DataCol = 0) then
  begin
    // Check the field value and assign a color
    // Feld-Wert prüfen und entsprechende Farbe wählen
    iValue := qryIn.FieldByName('HINWEIS_COLOR').AsInteger;
    case iValue of
      1: dbgIn.Canvas.Brush.Color := clGreen;
      2: dbgIn.Canvas.Brush.Color := clLime;
      3: dbgIn.Canvas.Brush.Color := clYellow;
      4: dbgIn.Canvas.Brush.Color := clRed;
    end;
    // Draw the field
    // Feld zeichnen
    dbgIn.DefaultDrawColumnCell(Rect, DataCol, Column, State);
  end;
end;

procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
  ColorGrid(DBGrid1, Query1, Rect, DataCol, Column, State);
end;

Titles

صفحه اصلی
Up
مقالات
Downloads
Beeper help
جستجو
تصاویر برنامه ها
تبلیغات
تماس با ما
وبلاگ شخصی

جستجو در سایت

لینک سایر سایت ها


 صفحه اصلی | مقالات | سوال و جواب | Downloads | Beeper help | جستجو | تصاویر برنامه ها | تبلیغات | تماس با ما | وبلاگ شخصی
در صورت بروز هر گونه مشكل در استفاده از نرم افزار هاي اين سايت, مشكل را با مدير اين سايت در ميان بگذاريد.

Creative Commons License
This work is licensed under a Creative Commons Attribution 2.5 License.

آخرين به روز رسانی: آمار بازدید: