[b]procedure[/b] TForm1.StringGrid1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
[b]var[/b]
OldBrush, InfoBoxBrush: HBRUSH;
InfoBoxDC: HDC;
[b]begin[/b]
InfoBoxDC := GetDC(GroupBox1.Handle);
[b]try[/b]
InfoBoxBrush := CreateSolidBrush(
RGB(Random(256), Random(256), Random(256)));
OldBrush := SelectObject(InfoBoxDC,InfoBoxBrush);
Rectangle(InfoBoxDC, 0,0,265,60);
SelectObject(InfoBoxDC,OldBrush);
DeleteObject(InfoBoxBrush);
[b]finally[/b]
ReleaseDC(GroupBox1.Handle, InfoBoxDC);
[b]end;[/b]
[b]end;[/b]