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

•  TDictionary Custom Sort  3 227

•  Fast Watermark Sources  2 992

•  3D Designer  4 751

•  Sik Screen Capture  3 259

•  Patch Maker  3 467

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

•  ListBox Drag & Drop  2 904

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

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

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

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

•  Canvas Drawing  2 674

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

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

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

•  Paint on Shape  1 525

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

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

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

•  Пазл Numbrix  1 649

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

•  Игра HIP  1 262

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

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

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

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

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

•  HEX View  1 466

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

•  Задача коммивояжера  1 357

 
скрыть


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

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



Delphi Sources

Комбинация 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.





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

Расширение компонента TEdit




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

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