Delphi程序轉C++ Builder問題 (50分)

  • 主题发起人 主题发起人 lexue
  • 开始时间 开始时间
L

lexue

Unregistered / Unconfirmed
GUEST, unregistred user!
[?]procedure TForm1.DBGrid1DrawDataCell (Sender: TObject;
const Rect: TRect;
Field: TField;
State: TGridDrawState);
begin
if (gdFocused in State) then
這句在C++ Builder中該怎么寫?(求高手指點)
begin
if (Field.FieldName = DBComboBox1.DataField ) then
begin
...
end;
end;
end;

 
if (gdFocused in State) 一句改为 if (State.Contains(gdFocused)) 即可!
完整转换如下:
int Col, Row;
void __fastcall TForm1::DBGrid1DrawDataCell(TObject *Sender,
const TRect &Rect, TField *Field, TGridDrawState State)
{
int RowHeight;
if (State.Contains(gdFocused))
{
RowHeight = Rect.Bottom - Rect.Top;
Row = (Rect.Top / RowHeight) - 1;
Col = Field->Index;
}
}
 
接受答案了.
 
后退
顶部