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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...