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

•  DeLiKaTeS Tetris (Тетрис)  3 788

•  TDictionary Custom Sort  5 902

•  Fast Watermark Sources  5 703

•  3D Designer  8 478

•  Sik Screen Capture  6 036

•  Patch Maker  6 480

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

•  ListBox Drag & Drop  5 338

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

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

•  Рисование по маске  5 801

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

•  Canvas Drawing  5 235

•  Рисование Луны  4 958

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

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

•  Paint on Shape  2 433

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

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

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

•  Пазл Numbrix  2 249

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

•  Игра HIP  1 879

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

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

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

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

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

•  HEX View  2 294

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

 
скрыть

  Форум  

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

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



Delphi Sources

Изменить поведение при нажатии для TRadioButton или TComboBox



Оформил: DeeCo

// Q: It appears that programatically setting Item.Index for the Radio Button 
// fires the onClick event.  It also appears  doing the same for the 
// ComboBox does NOT fire the OnClick event. Does another property the two 
// control effect this behavior. 

// A: No, it is caused by the way Windows sends the notifications that fire the 
// event when the control state is changed by a program action. 

// Q: I have an instance where I need each of 
// the control to exhibit the opposite behavior. 

// A: For a TRadiobutton you can disconnect the OnClick handler, change the 
// state, then reconnect the handler. 

procedure ChangeRadiobuttonState(ARadiobutton: TRadiobutton;
   checkit: Boolean);
 var
   oldhandler: TNotifyEvent;
 begin
   oldhandler := ARadiobutton.Onclick;
   ARadiobutton.Onclick := nil;
   ARadiobutton.Checked := checkit;
   ARadiobutton.OnClick := oldhandler;
 end;


 // To make the combobox "click" after setting the item index simply call its 
// Click method. The control inherits this method from TControl, but it is 
// protected. So you need a bit of hoop-jumping: 

Type
   TComboCracker = class(TCombobox);

 procedure SetComboboxIndex(ACombobox: TCombobox; Index: Integer);
 begin
   ACombobox.ItemIndex := Index;
   TCombocracker(ACombobox).Click;
 end;




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

Примеры работы с БД

Примеры оформления DBGrid

Пример использования DBGrid

База предприятий и менеджеров 0.99

 

Консольное DOS приложение

Работа с принтером

Локализация приложений

Нейросеть для распознавания образов

 

Механизм станка качалки для нефти

Весы для взвешивания

Кувшины для воды

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

 



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

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