ソス@ソスソスstringgridソスナセソスソスソスソスソスrソスソスソスト茨ソスvソスソスソスネゑソスソスソスソスソスソスソスFソスソスtソスソスソスソスノは?
|
ソスEC/C++
ソスEDelphi
ソスEVisual BasicソスソスソスSソスソス
ソス@(VB2-VB6ソスソス.NETソスソスソスp)
ソスEVisual Basic(VB2-VB6)
ソスEVisual Basic .NET
ソスEVisual C++
ソスEpapy's softwarelibrary
ソス@-----------------------------------------
ソスP| ソス` | ソスa | ソスb | ソスc |
ソス@-----------------------------------------
ソスQ| ソス` | ソスa | ソスb | ソスc |
ソス@-----------------------------------------
ソスsソスフセソスソスソス`ソスニセソスソスソスaソスフ抵ソスソスgソスソスソスrソスソスソスト、ソスソスvソスソスソスネゑソスソスソスソスソスソス轤サソスフ行ソスソスuソスヤゑソスソスvソスソスソスソスソスソスソスナゑソスソスB
ソスソスvソスソスソスソスソス鼾ソスヘ会ソスソスソスソスソスワゑソスソスソスB
ソスFソスソスツゑソスソス驍アソスニはでゑソスソスソスソスフでゑソスソスソスソスAソスヌゑソスソスソスソストゑソスSソスフに色ソスソスソスツゑソスソストゑソスソスワゑソスソスワゑソスソスB
ソスかソスソステらいソスソスソスソスナ申ソスソスソスあゑソスワゑソスソスソスB
ソスソスソスソスソスしソスソスソスソスホ具ソスソスソスソストゑソスソスソスソスソスソスソスソスBソスソスソス閧「ソスvソスソスソスワゑソスソスB
>ソスFソスソスツゑソスソス驍アソスニはでゑソスソスソスソスフでゑソスソスソスソスAソスヌゑソスソスソスソストゑソスSソスフに色ソスソスソスツゑソスソストゑソスソスワゑソスソスワゑソスソスB
ソスヌのようソスネコソス[ソスhソスソスソスソスソスソストゑソスソスソスフでゑソスソスソスソスH
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if gdFixed in State then Exit;
// 1 ソスソス Aソスソス ソスフセソスソス
// 2 ソスソス Bソスソス ソスフセソスソス
if StringGrid1.Cells[1, ARow] <> StringGrid1.Cells[2, ARow] then
begin
StringGrid1.Canvas.Brush.Color := clRed;
StringGrid1.Canvas.FillRect(Rect);
StringGrid1.Canvas.TextRect(Rect, Rect.Left+2, Rect.Top+2,
StringGrid1.Cells[ACol, ARow]);
end;
end;
ソスソスソスニゑソスソスホゑソスソスソスソスソスソスソスニゑソスソスH
// 1 ソスソス Aソスソス ソスフセソスソス
// 2 ソスソス Bソスソス ソスフセソスソス
if (ACol=1) or (ACol=2) then
if StringGrid1.Cells[1, ARow] <> StringGrid1.Cells[2, ARow] then
begin
StringGrid1.Canvas.Brush.Color := clRed;
StringGrid1.Canvas.FillRect(Rect);
StringGrid1.Canvas.TextRect(Rect, Rect.Left+2, Rect.Top+2,
StringGrid1.Cells[ACol, ARow]);
end;
ソスソスソスsソスソスソスノセソスソスソスフ編集ソスヘ行ソスソスソスフゑソスソスネ?
ソスソスソスヤ趣ソスソスxソスソスソスネゑソスソストゑソスソスワゑソスソスソスマ申ソスソスソスあゑソスワゑソスソスソスB
ソスFソスlソスソスソスソスソスソスソスソスフ回答本ソスソスソスノゑソスソス閧ェソスニゑソスソスソスソスソスソスソスソスワゑソスソスB
ソスソスソスソスソストみゑソスソスフでゑソスソスソスソスAstringgridソスフセソスソスソスSソストゑソスソスヤゑソスソスネゑソスソストゑソスソスワゑソスソスワゑソスソスソスソスB
ソスソスソスソスソスフ趣ソスソスソスフ仕ソスソスソスソスソスソスソスソスソスソスソスソスソスフゑソスソスソスソスソスソスワゑソスソスソスB
ソス@ ソス@ソス`ソス@ ソス@ソスaソス@ ソス@ソスbソス@ ソス@ソスc
ソス@--------------------------
ソスP|ソスZソスソスソスP|ソスZソスソスソスQ|ソスZソスソスソスR|ソスZソスソスソスS|
ソス@--------------------------
if stringgrid1.cells[1,A(ソスZソスソスソスPソスフ抵ソスソスg)] <> stringgrid1.cells[1,B(ソスZソスソスソスQソスフ抵ソスソスg)] then
begin
ソスZソスソスソスPソスソスヤゑソスソスFソスtソスソス;
ソスZソスソスソスQソスソスヤゑソスソスFソスtソスソス;
ソスZソスソスソスRソスソスヤゑソスソスFソスtソスソス;
ソスZソスソスソスSソスソスヤゑソスソスFソスtソスソス;
end;
ソスソスソスフようソスネ擾ソスソスソスソスソスソスソスソスソスソスソスソスソスフでゑソスソスソスソスAソスヌゑソスソスLソスqソスソスソスソスフゑソスソス謔「ソスフでゑソスソス蛯、ソスソスソスH
ソスソスソスxソスソス¥ソスソスソスあゑソスワゑソスソスソスBソスソスソスミ具ソスソスソスソストゑソスソスソスソスソスソスソスソスB
>ソスソスソスソスソスSソスメでゑソス
ソスソスソスソスソス艪、ソスソスソスOソスヘ鯉ソスソスソスソスワゑソスソスAソスソスソスソスソスワとゑソスネ厄ソスソスOソスソスtソスソスソスソスソス骼厄ソスソスソス]ソスソスソスワゑソスソスB
>ソスソスソスソスソスフ趣ソスソスソスフ仕ソスソスソスソスソスソスソスソスソスソスソスソスソスフゑソスソスソスソスソスソスワゑソスソスソスB
ソスソスソス轤ュソスFソスソスソス質厄ソスフ難ソスeソスヘ包ソスソスソスソスソスソストゑソスソスソスソスソスニ思ソスソスソスワゑソスソスB
>ソスソスソスソスソストみゑソスソスフでゑソスソスソスソスAstringgridソスフセソスソスソスSソストゑソスソスヤゑソスソスネゑソスソストゑソスソスワゑソスソスワゑソスソスソスソスB
igy ソスフ趣ソスソスソスノゑソスソスソスソスソスソス黷スソスソスソスソスソスソスソスソスソスソスソスソスソスソスニ思ソスソスソスワゑソスソスB
ソスロむぽゑソス ソスAソスリゑソスソスソスフ例示ソスソスソス黷スソスソスソス@ソスヘ包ソスソスソスソスソスソスト趣ソスソスソスソスソスワゑソスソスソスソスソスソスB
ソスソスソス轤ュソスソスソスソスソスSソスメでゑソスソスニ厄ソスソスソスソスソストゑソスソスソスソスソスフでゑソスソスソスソスナ包ソスソスソスソスソスネゑソスソスフでゑソスソスソスソスソスA
ソスソスソスフ包ソスソス@ソスヘゑソスソスソスソスソスソスト擾ソス閧ュソスsソスソスソスワゑソスソスがと趣ソスソス竄ウソス黷スソスソスソスソスソスヌゑソスソスソスソスニ。
KHE00221 ソスソスソスソスフ趣ソスソスソスノゑソスソスソスソスソスソス黷スソスソスソスソスソスソスノ進ソズと思ソスソスソスワゑソスソスソスソスB
igy ソスソスソスソスソストび捨てまゑソスソスソスソスAソスソスソス轤オソスワゑソスソスソスソスB
ソスロむぽゑソス ソスソスソスソスフ包ソスソス@ソスナ、ソスソスソスソスソスソストゑソスソスソス謔、ソスネ気ソスソスソスソスソスワゑソスソスソスソスAソスソスソス゚ゑソスソスノ、FormソスソスButton1sソスソスstringGrid1(ColCount ソスソス 5ソスARowCount ソスソス 10ソスノ設抵ソス)ソスソス¥ソスソスtソスソスソスト、ソスソスソスフエソスxソスソスソスgソスソスン定しソスト趣ソスソスソスソストみてゑソスソスソスソスソスソスソスソスB
procedure TForm1.Button1Click(Sender: TObject);
var
R,C: Integer;
begin
Randomize;
for R := 1 to 10 do
for C := 1 to 4 do
begin
StringGrid1.Cells[C, R] := intToStr(Random(5));
end;
end;
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
if gdFixed in State then Exit;
// 1 ソスソス Aソスソス ソスフセソスソス
// 2 ソスソス Bソスソス ソスフセソスソス
if StringGrid1.Cells[1, ARow] <> StringGrid1.Cells[2, ARow] then
begin
StringGrid1.Canvas.Brush.Color := clRed;
StringGrid1.Canvas.FillRect(Rect);
StringGrid1.Canvas.TextRect(Rect, Rect.Left+2, Rect.Top+2, StringGrid1.Cells[ACol, ARow]);
end;
end;
ソスルゑソス
TInplaceEdit = class(Grids.TInplaceEdit);
TComparisonStyle = (csNone,csENTER,csREAL);
TStringGrid = class(Grids.TStringGrid)
private
FSaveRow: Integer;
FSaveCol: Integer;
FComparisonColor: TColor;
FComparison: TComparisonStyle;
FComparisonCol1: Integer;
FComparisonCol2: Integer;
procedure SetComparisonColor(Value: TColor);
procedure SetComparison(Value: TComparisonStyle);
procedure SetComparisonCol1(Value: Integer);
procedure SetComparisonCol2(Value: Integer);
protected
procedure DrawCell(ACol, ARow: Longint; ARect: TRect;
AState: TGridDrawState); override;
function GetEditText(ACol, ARow: Longint): string; override;
procedure SetEditText(ACol, ARow: Longint; const Value: string); override;
procedure KeyPress(var Key: Char); override;
public
constructor Create(AOwner: TComponent); override;
published
property Comparison: TComparisonStyle read FComparison write SetComparison;
property ComparisonColor: TColor read FComparisonColor write SetComparisonColor;
property ComparisonCol1: Integer read FComparisonCol1 write SetComparisonCol1;
property ComparisonCol2: Integer read FComparisonCol2 write SetComparisonCol2;
end;
//---------------------------------------
procedure TStringGrid.SetComparisonColor(Value: TColor);
begin
FComparisonColor := Value;
Invalidate;
end;
procedure TStringGrid.SetComparison(Value: TComparisonStyle);
begin
FComparison := Value;
Invalidate;
end;
procedure TStringGrid.SetComparisonCol1(Value: Integer);
begin
FComparisonCol1 := Value;
Invalidate;
end;
procedure TStringGrid.SetComparisonCol2(Value: Integer);
begin
FComparisonCol2 := Value;
Invalidate;
end;
procedure TStringGrid.KeyPress(var Key: Char);
var
C: TColor;
begin
if (Key = #13) and (FComparison = csENTER) then
begin
if (FSaveCol <> -1) and (FSaveRow <> -1) then
begin
C := Color;
if Cells[FComparisonCol1, FSaveRow] <> Cells[FComparisonCol2, FSaveRow] then
begin
C := FComparisonColor;
end;
TInplaceEdit(InplaceEditor).Color := C;
InvalidateRow(FSaveRow);
end;
end;
inherited KeyPress(Key);
end;
procedure TStringGrid.SetEditText(ACol, ARow: Longint; const Value: string);
var
C: TColor;
begin
inherited;
if (FComparison = csREAL) then
begin
C := Color;
if Cells[FComparisonCol1, ARow] <> Cells[FComparisonCol2, ARow] then
begin
C := FComparisonColor;
end;
TInplaceEdit(InplaceEditor).Color := C;
InvalidateRow(FSaveRow);
end;
end;
function TStringGrid.GetEditText(ACol, ARow: Longint): string;
var
C: TColor;
begin
Result := inherited GetEditText(ACol,ARow);
if (FComparison <> csNONE) then
begin
FSaveCol := ACol;
FSaveRow := ARow;
C := Color;
if Cells[FComparisonCol1, ARow] <> Cells[FComparisonCol2, ARow] then
begin
C := FComparisonColor;
end;
TInplaceEdit(InplaceEditor).Color := C;
end;
end;
procedure TStringGrid.DrawCell(ACol, ARow: Longint; ARect: TRect;AState: TGridDrawState);
begin
if (FComparison <> csNONE) then
begin
if gdFixed in AState then
begin
inherited DrawCell(ACol, ARow, ARect, AState);
end
else
begin
Canvas.Brush.Color := Color;
if Cells[FComparisonCol1, ARow] <> Cells[FComparisonCol2, ARow] then
begin
Canvas.Brush.Color := FComparisonColor;
end;
end;
end;
inherited DrawCell(ACol, ARow, ARect, AState);
end;
constructor TStringGrid.Create(AOwner: TComponent);
begin
inherited;
FSaveCol := -1;
FSaveRow := -1;
FComparison := csREAL;
FComparisonCol1 := 1;
FComparisonCol2 := 2;
FComparisonColor := clRed;
end;
ソスFソスlソスフゑソスソスソスソスソスソスナ会ソスソスソスソスソス驍アソスニゑソスソスナゑソスソスワゑソスソスソスソスB
ソス{ソスソスソスノゑソスソス閧ェソスニゑソスソスソスソスソスソスソスソスワゑソスソスソスソスB