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

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

•  TDictionary Custom Sort  3 336

•  Fast Watermark Sources  3 087

•  3D Designer  4 846

•  Sik Screen Capture  3 340

•  Patch Maker  3 552

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

•  ListBox Drag & Drop  3 014

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

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

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

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

•  Canvas Drawing  2 751

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

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

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

•  Paint on Shape  1 568

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

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

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

•  Пазл Numbrix  1 685

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

•  Игра HIP  1 282

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

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

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

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

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

•  HEX View  1 497

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

 
скрыть


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

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



Delphi Sources

Получить доступ к элементам TRadioGroup



Оформил: DeeCo

{ 
  Die Eigenschaft Controls fuhrt alle untergeordneten Komponenten eines Steuerelements 
  (Hier z.B TRadioGroup) auf. 
  Controls ist hilfreich, wenn auf die untergeordneten Steuerelemente mit einer Zahl und 
  nicht mit ihrem Namen Bezug genommen werden soll. 
  So kann Controls beispielsweise verwendet werden, um in einer TRadioGroup Eigenschaften 
  der RadioButtons zu manipulieren (Hints anzeigen, verstecken,...) 
}

 { 
  The property Controls lists all child controls of a Control.(Here a TRadioGroup) 
  Controls is an array of all the child controls. 
  The Controls property is convenient for referring to the children of a control 
  by number rather than name. 
  For example, Controls may be used to change properties of the Radiobuttons in a 
  TRadioGroup (showing hints, hiding items,...) 
}


 {1. *******************************************************}
 // Deactivates/activates a specified item of a TRadioGroup 
// Deaktiviert/aktiviert in einer TRadioGroup ein bestimmtes Item 

procedure RGB_EnableItem(RadioGroup: TRadioGroup; ItemIndex: Byte; bEnabled: Boolean);
 begin
   RadioGroup.Controls[ItemIndex].Enabled := bEnabled;
 end;

 // Example: Deactivates the 2. Item  (Index starts at 0) 
// Beispiel: 2. Item deaktivieren (Index beginnt bei 0) 

procedure TForm1.Button1Click(Sender: TObject);
 begin
   RGB_EnableItem(RadioGroup1, 1, False);
 end;


 {2. *******************************************************}
 // Hides/Shows a specified item of a TRadioGroup 
// Versteckt oder zeigt ein bestimmtes Item in einer TRadioGroup an. 
procedure RGB_ShowItem(RadioGroup: TRadioGroup; ItemIndex: Byte; bVisible: Boolean);
 begin
   RadioGroup.Controls[ItemIndex].Visible := bVisible;
 end;

 // Example: Hides the 2. Item  (Index starts at 0) 
// Beispiel: 2. Item verstecken (Index beginnt bei 0) 
procedure TForm1.Button2Click(Sender: TObject);
 begin
   RGB_ShowItem(RadioGroup1, 1, False);
 end;


 {3. *******************************************************}
 // Show Hints for TRadioGroup items 
// Hints fur die Items in der TRadioGroup anzeigen 
procedure TForm1.Button3Click(Sender: TObject);
 var
   i: Byte;
 begin
   for i := 0 to RadioGroup1.ControlCount - 1 do
   begin
     RadioGroup1.Controls[i].ShowHint := True;
     RadioGroup1.Controls[i].Hint := (Radiogroup1.Controls[i] as TRadiobutton).Caption;
   end;
 end;

 {4. *******************************************************}
 // Focus a specified Radiobutton in a TRadioGroup 
// Ein bestimmter Radiobutton einer TRadioGroup fokussieren 
procedure RGB_FocusItem(RadioGroup: TRadioGroup; ItemIndex: Byte);
 var
   RadiogroupClick: TNotifyEvent;
 begin
   if ItemIndex >= 0 then
   begin
     RadioGroup.OnClick := nil;
     (RadioGroup.Controls[1] as TRadiobutton).SetFocus;
     RadioGroup.OnClick := RadiogroupClick;
   end;
 end;

 // Example: Focus the 2. Radiobutton 
// Beispiel: Den 2. Radiobutton fokussieren 
procedure TForm1.Button4Click(Sender: TObject);
 begin
   RGB_FocusItem(RadioGroup1, 1);
 end;







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

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