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

•  Animation Loaders  928

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

•  TDictionary Custom Sort  7 820

•  Fast Watermark Sources  7 493

•  3D Designer  10 727

•  Sik Screen Capture  8 045

•  Patch Maker  8 253

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

•  ListBox Drag & Drop  7 122

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

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

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

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

•  Canvas Drawing  6 714

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

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

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

•  Paint on Shape  3 430

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

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

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

•  Пазл Numbrix  2 820

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

•  Игра HIP  2 541

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

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

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

•  Генератор лабиринта  3 113

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

•  HEX View  3 003

 
скрыть

  Форум  

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-2026 "Delphi Sources" by «SiteAnalyzer». Delphi World FAQ

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