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

•  Animation Loaders  641

•  DeLiKaTeS Tetris (Тетрис)  5 656

•  TDictionary Custom Sort  7 613

•  Fast Watermark Sources  7 306

•  3D Designer  10 504

•  Sik Screen Capture  7 823

•  Patch Maker  8 052

•  Айболит (remote control)  8 108

•  ListBox Drag & Drop  6 915

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

•  Графические эффекты  8 172

•  Рисование по маске  7 572

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

•  Canvas Drawing  6 542

•  Рисование Луны  6 469

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

•  Рисование стержней  4 571

•  Paint on Shape  3 278

•  Генератор кроссвордов  4 263

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

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

•  Пазл Numbrix  2 743

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

•  Игра HIP  2 448

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

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

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

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

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

•  HEX View  2 903

 
скрыть

  Форум  

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

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



Delphi Sources

Определить и выставить значение текстового свойства





unit StrForm;

interface

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

type
  TForm1 = class(TForm)
    ButtonGet: TButton;
    EditProperty: TEdit;
    Label1: TLabel;
    Bevel1: TBevel;
    ButtonTrial: TButton;
    Label2: TLabel;
    LabelResult: TLabel;
    ButtonSet: TButton;
    Label3: TLabel;
    EditValue: TEdit;
    procedure ButtonGetClick(Sender: TObject);
    procedure ButtonSetClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

uses
  TypInfo;

procedure TForm1.ButtonGetClick(Sender: TObject);
var
  PropInfo: PPropInfo;
begin
  if not Assigned (ButtonTrial) then
    ShowMessage ('The button has been renamed')
  else
  begin
    PropInfo := GetPropInfo (
      ButtonTrial.ClassInfo, EditProperty.Text);
    if PropInfo <> nil then
      if PropInfo^.PropType^.Kind =
          tkLString then
        LabelResult.Caption :=
          GetStrProp (ButtonTrial, PropInfo)
      else
        ShowMessage ('Not a string property')
    else
      ShowMessage ('Property doesn''t exist');
  end;
end;

procedure TForm1.ButtonSetClick(Sender: TObject);
var
  PropInfo: PPropInfo;
begin
  if not Assigned (ButtonTrial) then
    ShowMessage ('The button has been renamed')
  else
  begin
    PropInfo := GetPropInfo (
      ButtonTrial.ClassInfo, EditProperty.Text);
    if PropInfo <> nil then
      if PropInfo^.PropType^.Kind =
          tkLString then
        SetStrProp (ButtonTrial, PropInfo, EditValue.Text)
      else
        ShowMessage ('Not a string property')
    else
      ShowMessage ('Property doesn''t exist');
  end;
end;

end.

Загрузить весь проект








Copyright © 2004-2026 "Delphi Sources" by «SiteAnalyzer». Delphi World FAQ

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