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

•  DeLiKaTeS Tetris (Тетрис)  4 174

•  TDictionary Custom Sort  6 234

•  Fast Watermark Sources  6 037

•  3D Designer  8 935

•  Sik Screen Capture  6 361

•  Patch Maker  6 782

•  Айболит (remote control)  6 763

•  ListBox Drag & Drop  5 640

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

•  Графические эффекты  6 983

•  Рисование по маске  6 263

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

•  Canvas Drawing  5 530

•  Рисование Луны  5 230

•  Поворот изображения  4 777

•  Рисование стержней  3 377

•  Paint on Shape  2 633

•  Генератор кроссвордов  3 520

•  Головоломка Paletto  2 810

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

•  Пазл Numbrix  2 367

•  Заборы и коммивояжеры  3 048

•  Игра HIP  2 004

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

•  Симулятор лифта  2 290

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

•  Генератор лабиринта  2 445

•  Проверка числового ввода  2 129

•  HEX View  2 463

•  Физический маятник  2 081

 
скрыть

  Форум  

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-2025 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

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