Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  150

•  TDictionary Custom Sort  3 330

•  Fast Watermark Sources  3 077

•  3D Designer  4 839

•  Sik Screen Capture  3 332

•  Patch Maker  3 546

•  Айболит (remote control)  3 651

•  ListBox Drag & Drop  3 006

•  Доска для игры Реверси  81 654

•  Графические эффекты  3 935

•  Рисование по маске  3 240

•  Перетаскивание изображений  2 621

•  Canvas Drawing  2 744

•  Рисование Луны  2 572

•  Поворот изображения  2 179

•  Рисование стержней  2 167

•  Paint on Shape  1 567

•  Генератор кроссвордов  2 233

•  Головоломка Paletto  1 767

•  Теорема Монжа об окружностях  2 221

•  Пазл Numbrix  1 685

•  Заборы и коммивояжеры  2 056

•  Игра HIP  1 281

•  Игра Go (Го)  1 228

•  Симулятор лифта  1 473

•  Программа укладки плитки  1 216

•  Генератор лабиринта  1 546

•  Проверка числового ввода  1 362

•  HEX View  1 495

•  Физический маятник  1 358

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

CheckBox в StringGrid





unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Grids, StdCtrls;

type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

const
 cell_x = 2;
 cell_y = 2;

var
  Form1: TForm1;
  CheckBox1: TCheckBox;

implementation

{$R *.DFM}

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var
 r:trect;
begin
 if(cell_x>=StringGrid1.LeftCol) and
   (cell_x<=StringGrid1.LeftCol+StringGrid1.VisibleColCount) and
   (cell_y>=StringGrid1.TopRow) and
   (cell_x<=StringGrid1.TopRow+StringGrid1.VisibleRowCount) then
     CheckBox1.Visible:=true
 else
     CheckBox1.Visible:=false;

 if (acol=cell_x) and (arow=cell_y) then
 begin
   r:=stringgrid1.CellRect(cell_x,cell_y);
   r.Left:=r.left+stringgrid1.left+2;
   r.right:=r.right+stringgrid1.left+2;
   r.top:=r.top+stringgrid1.top+2;
   r.bottom:=r.bottom+stringgrid1.top+2;
   CheckBox1.BoundsRect:=r;
 end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
 CheckBox1:=TCheckBox.Create(form1);
 CheckBox1.parent:=form1;
 CheckBox1.Caption:='proba';
end;

end.





Похожие по теме исходники

CheckBox in StringGrid

DBLookupComboBox in StringGrid

Cell hint in StringGrid

Components in StringGrid

 

Сапер StringGrid

StringGrid Decoration

TStringGridCheker

TQGRID Perfect StringGrid

 

OwnerDraw StringGrid




Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте