herculanojs Posted April 8, 2016 Share Posted April 8, 2016 I'm having trouble in assigning TriggerEvent when we created the component at runtime. The award of the event simply does not work. But if the event is already assigned to a component already created, it works. What should you do following example? Tengo problemas en la asignación de eventos TriggerEvent cuando creamos el componente en tiempo de ejecución. El premio del evento no funciona. Pero si el evento ya está asignado a un componente ya creado, funciona. ¿Qué debo hacer? procedure TMainForm.UniComboBox1TriggerEvent(Sender: TUniCustomComboBox;AButtonId: Integer); begin ShowMessage (IntToStr (AButtonId)); end; with TUniComboBox(InsertControl(TUniComboBox.Create(self))) do begin Left: = 100; Width: = 300; Top: = 200; OnTriggerEvent: = UniComboBox1TriggerEvent; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 8, 2016 Share Posted April 8, 2016 Hi, For example: procedure TMainForm.UniButton1Click(Sender: TObject); var trigger: TUniComboTrigger; begin with TUniComboBox.Create(Self) do begin Parent := Self; Left := UniButton1.Left; Top := UniButton1.Top - 50; OnTriggerEvent := UniComboBox1TriggerEvent; trigger := Triggers.Add; trigger.ButtonId := 0; trigger.HandleClicks := False; trigger := Triggers.Add; trigger.ButtonId := 1; trigger.HandleClicks := True; trigger.IconCls := 'x-form-date-trigger'; trigger := Triggers.Add; trigger.ButtonId := 2; trigger.HandleClicks := True; trigger.IconCls := 'x-form-search-trigger'; end; end; Best regards. Quote Link to comment Share on other sites More sharing options...
herculanojs Posted April 8, 2016 Author Share Posted April 8, 2016 tanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.