Jump to content

How get text written in a Combo Button after clicking trigger button


Pep

Recommended Posts

 Hello,

How can I get the text that a user has recently written in a Combobutton in the form UniForm1.TextEdit

Sample:

image.png.58e7e8071774bbe099d92854122fdbd1.png

 

I have try

procedure TMainForm.UniComboBox3TriggerEvent(Sender: TUniCustomComboBox;
  AButtonId: Integer);
begin
  if AButtonId = 1 then
  begin
    UniDBGrid1.CancelEditing(True);
    UniForm1.UniEdit1.Text := Sender.Text; // Doesn't work
    UniForm1.ShowModal(GridCallBack);
  end

 

but doesn't work.

Thanks a lot.

Link to comment
Share on other sites

It works for me:

procedure TMainForm.UniComboBox1TriggerEvent(Sender: TUniCustomComboBox; AButtonId: Integer);
begin
  if AButtonId = 1 then
  begin
    ShowMessage(Sender.Text);
  end;
end;

By the way if I copy this line from your code above and paste it I noticed that there are strange characters just after the "d" in Sender and just before the two slashes. see picture. Try and delete the code and type from scratch. You probably copied it from somewhere on the forum, I have noticed the issue with the new forum.

UniForm1.UniEdit1.Text := Sender.Text; // Doesn't work

chrome_2019-01-23_14-23-01.png.24188d5d546d601e4eeda11b64cb2027.png

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...