Delphi - cxLookupCombobox'a buton ekleme

Aşağıdaki kodla MRUEdit gibi cxLookupCombobox’a button ekleyip, butonlara da kendi yazdığınız ya da herhangi bir OnButtonClick event’ini bağlayabilirsiniz.
Event’de AbuttonIndex kontrolü yapmazsanız LookupCombobox’ın standart butonu içinde –Liste açıkken tıklarsanız- yazacağınız kod çalışıyor. –Başka bir amaç için ihtiyacaç olabilir-
type
TcxCustomEditPropertiesAccess = class(TcxCustomEditProperties);
...
TcxCustomEditPropertiesAccess(cmb_Park_Group.Properties).OnButtonClick := myPropertiesButtonClick; //event bağla
with TcxCustomEditPropertiesAccess(cmb_Park_Group.Properties).Buttons.Add do
begin
Kind := bkEllipsis;
LeftAlignment := True; //Butonları sol tarafa alırend;
procedure TForm1.myPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
if AButtonIndex = 1 then
begin
ShowMessage('TEST');
end;


Yorumlar

Bu blogdaki popüler yayınlar

Delphi - What does Abort/Break/Exit

Türkçe Upper

$REGION