Trouble when creating custom TComboBox component lazarus / 31-LCL ---------------------------------------------------------------------- darkdata · 2015-03-26 16:19 Hi all, I'm having trouble creating a TCustomComboBox component. I'm overriding Dropdown but it seems like the event never gets fired? Code: [Select]  TTDComboBox = class(TCustomComboBox)   private     { Private declarations }   protected     { Protected declarations }     procedure DropDown; override; Code: [Select]procedure TTDComboBox.DropDown; var   i: Integer; begin //just a test //SendMessage(Self.Handle, CB_SETDROPPEDWIDTH, ItemWidth, 0); Self.Perform(CB_SETDROPPEDWIDTH, 100, 0); What am I doing wrong here? ---------------------------------------------------------------------- skalogryz · 2015-03-26 17:36 Perform() executes LCL code only. I presume you want so actually send the message to actual Windows control. Use Windows.SendMessage for that. ---------------------------------------------------------------------- darkdata · 2015-03-26 19:16 I tried both. The SendMessage/Self.Perform pieces work fine with OnDropDown event of a TComboBox. Here's a link to something similar I'm trying to achieve: http://www.delphicorner.f9.co.uk/articles/comps11.htm ---------------------------------------------------------------------- skalogryz · 2015-03-26 19:31 are you saying it works with TComboBox but not working with TCustomComboBox? Are there other changes made? because it works with for TCustomComboBox as well. ---------------------------------------------------------------------- darkdata · 2015-03-26 19:53 Could you try making a TCustomComboBox package/component? That's where I seem to have the trouble. ---------------------------------------------------------------------- skalogryz · 2015-03-26 20:32 i presume you didn't use SendMesssage after all. Anyways. here's the package and a project that's using the package. Works as expected (on windows) As soon as package is installed and Lazarus is rebuilt you'll see "dark data" tab where the dropdown resides. ---------------------------------------------------------------------- skalogryz · 2015-03-26 20:39 I've just attached the package zip file. Not sure why didn't load the last time. ---------------------------------------------------------------------- darkdata · 2015-03-26 20:45 Ok yours works. You can see that I did try to use SendMessage above though in my original post. When I created a component I did not get the extra file for the registration of the component like yours has. I'll have to dig to figure out how I missed this. Thanks. ---------------------------------------------------------------------- skalogryz · 2015-03-26 20:54 Quote from: darkdata on March 26, 2015, 09:45:27 pmWhen I created a component I did not get the extra file for the registration of the component like yours has. I didn't get it too. I created one myself.