
03.07.2011, 23:23
|
 |
Новичок
|
|
Регистрация: 25.05.2009
Адрес: Казахстан, Павлодар
Сообщения: 87
Версия Delphi: Rad Studio 2010
Репутация: 1570
|
|
Создаёшь компонент-наследник стандартного DBGrid и в нём фигаришь необходимые свойства:
Код:
unit CoolDBGrid;
interface
uses
SysUtils, Classes, Controls, Grids, DBGrids, WinTypes, WinProcs, Messages,
Graphics, Forms, Dialogs, DB, Menus;
type
TCoolDBGrid = class(TDBGrid)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
property Canvas;
function CellRect(ACol, ARow: Longint): TRect;
property Col; //текущий столбец
property Row;//текущая строка
property InplaceEditor;//Содержимое ячейки. Можно использовать для копирования в буфер обмена
property DefaultRowHeight;//Высота строки по умолчанию
published
{ Published declarations }
property OnClick;//Щелчок мыши
property RowCount;//Количество строк (вместе с заголовками)
property ColCount;//Количество столбцов (Вместе с индикатором)
property VisibleColCount;//Примерно то же самое
property VisibleRowCount;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Others', [TCoolDBGrid]);
end;
function TCoolDBGrid.CellRect(ACol, ARow: Longint): TRect;
begin
Result := inherited CellRect(ACol, ARow);
end;
end.
__________________
Если ты чего-то не знаешь, значит есть шанс научиться чему-то новому
|