AGrid.SetRowProperty(ARow+1,pnFontStyle,pointer(fsUnderline));就是这句系统始终报错。
SetRowProperty的原型是这样的,请大家帮我看看,那里错了,调了很久都没搞定,谢谢!
procedure TCustomEasyGrid.SetRowProperty(RowIndex: Integer;
PropertyName: TPropertyName; Value: Pointer);
var
ACol: Integer;
begin
if (RowIndex < 1) or (RowIndex >= RowCount) then Exit;
for ACol:=1 to ColCount - 1 do
case PropertyName of
pnDataStyle :
Cells[ACol, RowIndex].DataStyle := TDataStyle(Value);
pnAlignMode :
Cells[ACol, RowIndex].AlignMode := TAlignMode(Value);
pnReadOnly :
Cells[ACol, RowIndex].ReadOnly := Boolean(Value);
pnAutoWordBreak :
Cells[ACol, RowIndex].AutoWordBreak := Boolean(Value);
pnShowForeText :
Cells[ACol, RowIndex].ShowForeText := Boolean(Value);
pnDrawTop :
Cells[ACol, RowIndex].DrawTop := Boolean(Value);
pnDrawLeft :
Cells[ACol, RowIndex].DrawLeft := Boolean(Value);
pnDrawRight :
Cells[ACol, RowIndex].DrawRight := Boolean(Value);
pnDrawBottom :
Cells[ACol, RowIndex].DrawBottom := Boolean(Value);
pnAllowNegative :
Cells[ACol, RowIndex].AllowNegative := Boolean(Value);
pnTrailingZero :
Cells[ACol, RowIndex].TrailingZero := Boolean(Value);
pnZeroNull :
Cells[ACol, RowIndex].ZeroNull := Boolean(Value);
pnThousandSep :
Cells[ACol, RowIndex].ThousandSep := Boolean(Value);
pnMaxLength :
Cells[ACol, RowIndex].MaxLength := Integer(Value);
pnIntLength :
Cells[ACol, RowIndex].IntLength := Integer(Value);
pnDecLength :
Cells[ACol, RowIndex].DecLength := Integer(Value);
pnLineWidth :
Cells[ACol, RowIndex].LineWidth := Integer(Value);
pnPenStyle :
Cells[ACol, RowIndex].PenStyle := TPenStyle(Value);
pnNumber :
Cells[ACol, RowIndex].Number := Integer(Value);
pnColor :
Cells[ACol, RowIndex].Color := TColor(Value);
pnFontSize :
Cells[ACol, RowIndex].FontSize := Integer(Value);
pnFontColor :
Cells[ACol, RowIndex].FontColor := TColor(Value);
pnFontStyle :
Cells[ACol, RowIndex].FontStyle := TFontStyles(Value^);
pnFontName :
Cells[ACol, RowIndex].FontName := PChar(Value);
pnForeText :
ForeTexts[ACol, RowIndex] := PChar(Value);
pnBackText :
BackTexts[ACol, RowIndex] := PChar(Value);
end;
InvalidateGrid;
SetRowProperty的原型是这样的,请大家帮我看看,那里错了,调了很久都没搞定,谢谢!
procedure TCustomEasyGrid.SetRowProperty(RowIndex: Integer;
PropertyName: TPropertyName; Value: Pointer);
var
ACol: Integer;
begin
if (RowIndex < 1) or (RowIndex >= RowCount) then Exit;
for ACol:=1 to ColCount - 1 do
case PropertyName of
pnDataStyle :
Cells[ACol, RowIndex].DataStyle := TDataStyle(Value);
pnAlignMode :
Cells[ACol, RowIndex].AlignMode := TAlignMode(Value);
pnReadOnly :
Cells[ACol, RowIndex].ReadOnly := Boolean(Value);
pnAutoWordBreak :
Cells[ACol, RowIndex].AutoWordBreak := Boolean(Value);
pnShowForeText :
Cells[ACol, RowIndex].ShowForeText := Boolean(Value);
pnDrawTop :
Cells[ACol, RowIndex].DrawTop := Boolean(Value);
pnDrawLeft :
Cells[ACol, RowIndex].DrawLeft := Boolean(Value);
pnDrawRight :
Cells[ACol, RowIndex].DrawRight := Boolean(Value);
pnDrawBottom :
Cells[ACol, RowIndex].DrawBottom := Boolean(Value);
pnAllowNegative :
Cells[ACol, RowIndex].AllowNegative := Boolean(Value);
pnTrailingZero :
Cells[ACol, RowIndex].TrailingZero := Boolean(Value);
pnZeroNull :
Cells[ACol, RowIndex].ZeroNull := Boolean(Value);
pnThousandSep :
Cells[ACol, RowIndex].ThousandSep := Boolean(Value);
pnMaxLength :
Cells[ACol, RowIndex].MaxLength := Integer(Value);
pnIntLength :
Cells[ACol, RowIndex].IntLength := Integer(Value);
pnDecLength :
Cells[ACol, RowIndex].DecLength := Integer(Value);
pnLineWidth :
Cells[ACol, RowIndex].LineWidth := Integer(Value);
pnPenStyle :
Cells[ACol, RowIndex].PenStyle := TPenStyle(Value);
pnNumber :
Cells[ACol, RowIndex].Number := Integer(Value);
pnColor :
Cells[ACol, RowIndex].Color := TColor(Value);
pnFontSize :
Cells[ACol, RowIndex].FontSize := Integer(Value);
pnFontColor :
Cells[ACol, RowIndex].FontColor := TColor(Value);
pnFontStyle :
Cells[ACol, RowIndex].FontStyle := TFontStyles(Value^);
pnFontName :
Cells[ACol, RowIndex].FontName := PChar(Value);
pnForeText :
ForeTexts[ACol, RowIndex] := PChar(Value);
pnBackText :
BackTexts[ACol, RowIndex] := PChar(Value);
end;
InvalidateGrid;
procedure TCustomEasyGrid.SetRowProperty(RowIndex: Integer;
PropertyName: TPropertyName; Value: Pointer);
var
ACol: Integer;
begin
if (RowIndex < 1) or (RowIndex >= RowCount) then Exit;
for ACol:=1 to ColCount - 1 do
case PropertyName of
...
pnFontStyle :
Cells[ACol, RowIndex].FontStyle := [TFontStyle(Integer(Value))];
...
end;
...
end;