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

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

•  TDictionary Custom Sort  6 724

•  Fast Watermark Sources  6 507

•  3D Designer  9 445

•  Sik Screen Capture  6 838

•  Patch Maker  7 288

•  Айболит (remote control)  7 230

•  ListBox Drag & Drop  6 090

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

•  Графические эффекты  7 406

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

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

•  Canvas Drawing  5 941

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

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

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

•  Paint on Shape  2 962

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

•  Головоломка Paletto  3 103

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

•  Пазл Numbrix  2 577

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

•  Игра HIP  2 312

•  Игра Go (Го)  2 211

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

•  Программа укладки плитки  2 203

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

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

•  HEX View  2 696

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

 
скрыть

Комбинация TLabel и TEdit



- Ваш компьютеp не загpужается. Мы тpебуем, чтоб сменили пpоцессоp! А в синей таблице (имеется в виду NC) были какие-то с pешётками (имеются в виду защищённые системные файлы). Наш сын хоpошо в этом pазбиpается, они в техникуме все компьютеpы пpоходят. Он сказал, что это сбои на винчестеpе, но ему удалось от них избавиться...


unit Editlbl1;

interface

uses

  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, stdctrls;

type

  TLabelEdit = class(TWinControl)
  private
    { Private declarations }
    FEdit: TEdit;
    FLabel: TLabel;
    function GetLabelCaption: string;
    procedure SetLabelCaption(LabelCaption: string);
    function GetEditText: string;
    procedure SetEditText(EditText: string);
  protected
    { Protected declarations }
  public
    { Public declarations }
    constructor Create(AOwner: TComponent); override;
  published
    property LabelCaption: string read GetLabelCaption write SetLabelCaption;
    property EditText: string read GetEditText write SetEditText;
    property Left;
    property Top;
    property Width;
    property Height;
    property Text;
    property Font;
    { Можете опубликовать другие, необходимые вам свойства. }
    { Published declarations }
  end;

procedure Register;

implementation

constructor TLabelEdit.Create(AOwner: TComponent);
begin

  inherited Create(AOwner);

  FEdit := TEdit.Create(self);
  FLabel := TLabel.Create(self);

  with FLabel do
  begin
    Width := FEdit.Width;
    visible := true;
    Parent := self;
    Caption := 'LabelEdit';
  end;

  with FEdit do
  begin
    Top := FLabel.Height + 2;
    Parent := self;
    Visible := true;
  end;

  Top := 0;
  Left := 0;
  Width := FEdit.Width;
  Height := FEdit.Height + FLabel.Height;
  Visible := true;
end;

function TLabelEdit.GetLabelCaption: string;
begin

  Result := FLabel.Caption;
end;

procedure TLabelEdit.SetLabelCaption(LabelCaption: string);
begin

  FLabel.Caption := LabelCaption;
end;

function TLabelEdit.GetEditText: string;
begin

  Result := FEdit.Text;
end;

procedure TLabelEdit.SetEditText(EditText: string);
begin

  FEdit.Text := EditText;
end;

procedure Register;
begin

  RegisterComponents('Test', [TLabelEdit]);
end;

end.