7373       Конференция Delphi SoobCha           письмо # 7374 7375  


Тема: Re[2]: Ячейку выделить цветом
Дата: Tue, 4 Mar 2008 08:49:50 +0700
Кому: "Delphi" <Delphi@soobcha.org>
X-Mailer: The Bat! (v3.5) Professional
Content-Type: text/plain; charset=koi8-r

     Здравствуйте, Алексей!

ЗАГ>> Подскажите, возможно ли программное выделение цветом ячейки,
ЗАГ>> столбца, строки в стандардтном DBGrid?
>>OnDraw* есть функция?
ЗАГ> Хм... А можно пример что и как?

Пример из хелпа делфей, правда, на С, но смысл ясен:


The following code uses the bitmaps in an image list component to draw
the contents of each cell in a draw grid. It draws a focus rectangle
around the cell that has focus.

void __fastcall TForm1::DrawGrid1DrawCell(TObject *Sender, long Col, long Row, TRect &Rect, TGridDrawState State)

{
  long index = Row * DrawGrid1->ColCount + Col;
  DrawGrid1->Canvas->Brush->Color = clNormalBackground;
  DrawGrid1->Canvas->FillRect(Rect);
  ImageList1->Draw(DrawGrid1->Canvas,Rect.Left,Rect.Top,index);
  if (State.Contains(gdFocused))
    DrawGrid1->Canvas->DrawFocusRect(Rect);
}

--
Всего наилучшего,
 Анатолий mailto:teml@npopm.ru


  7373 7375  
 
???Mail.ru ??? ?????
╘ 2000-2006 Сообщество Чайников