Q&A

  • gdFocused in State 가 안먹는데.. 왜그런지
여러 고수님들의 조언 좀 부탁드립니다.

다순하게 해당셀에 포커스가 잡히면 Brush칼라가 바뀌는 것을 작업할려고 합니다.

그런데 그 전부터 계속 gdFocused in State가 안먹는 거 같습니다.

무슨 다른 팁이 있는지.. 고수님들 조언 좀 부탁드립니다.

계속 안되서 미루고 다른 쉬운 것이라도 해결할려고 하는데.. 계속 막혀서 너무나 답답합니다. 좋은 소스와 많은 조언에도 불구하고 워낙 초보라 소용이 없네요.



하하. 그래도..



procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState);

begin if (gdFocused in State) then

with (Sender as TDBGrid).Canvas do

begin

Brush.Color := clRed;

FillRect(Rect);

TextOut(Rect.Left, Rect.Top, Field.AsString);

end;

end;

1  COMMENTS
  • Profile
    뿌요 2001.02.02 03:07


    DrawDataCell event를 일으킬려면

    DBGrid.Columns.State := csDefault;

    로 해주어야 되요.. 고럼..





    > procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState);

    > begin if (gdFocused in State) then

    > with (Sender as TDBGrid).Canvas do

    > begin

    > Brush.Color := clRed;

    > FillRect(Rect);

    > TextOut(Rect.Left, Rect.Top, Field.AsString);

    > end;

    > end;