TsDBLookupComboBox has changed

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37387
    Ronaldo Souza
    Participant

    How can I detect a TsDBLookupComboBox's “Text” has changed?

    Is there a way to access the text shown in the combo? (would be a nice read only property to add to the component… an OnChange event too 🙂

    TIA,

    Ronaldo

    #56348
    Support
    Keymaster

    Hello

    I think, you should use standard ways for this, I mean the DataSource.OnChange event or your DBField.OnChange event.

    #56409
    Ronaldo Souza
    Participant
    'Support' wrote:

    Hello

    I think, you should use standard ways for this, I mean the DataSource.OnChange event or your DBField.OnChange event.

    This event fires way too many times in my case, even before the fields get fully defined, so I ended up with a rather simple solution:

    Code:
    //VERY simplified pseudo-code
    procedure TForm1.sDBLookupComboBoxOnClick(Sender: TObject);
    begin
    if (Table1Item.AsString fLastItem)
    then begin
    fLastItem := Table1Item.AsString; //save for next check
    ShowMessage('ITEMS ARE DIFFERENT!')
    end;
    end;

    Best regards,

    Ronaldo

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.