Recent

Author Topic: Assigning text to ComboBox don't fires "ComboBox1Change"  (Read 7227 times)

bonmario

  • Sr. Member
  • ****
  • Posts: 346
Assigning text to ComboBox don't fires "ComboBox1Change"
« on: April 24, 2010, 08:26:30 am »
Hi, i have in a project a ComboBox:

Code: [Select]
procedure TForm1.FormCreate(Sender:TObject);
begin
  ComboBox1.Items.Add('aaa');
  ComboBox1.Items.Add('bbb');
end;

When i change the "Text" of the comboBox with this code, the "ComboBox1Change" is non executed.
Code: [Select]
ComboBox1.Text:='bbb';
It's a bug?

Thanks, MArio

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Assigning text to ComboBox don't fires "ComboBox1Change"
« Reply #1 on: April 24, 2010, 09:55:13 am »
Should it? AFAIK it's triggered when ItemIndex is changed.

bonmario

  • Sr. Member
  • ****
  • Posts: 346
Re: Assigning text to ComboBox don't fires "ComboBox1Change"
« Reply #2 on: April 24, 2010, 12:35:00 pm »
I don't know if it's a bug or not, but i've tried now and also changing ItemIndex "Change" is not fired.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2673
Re: Assigning text to ComboBox don't fires "ComboBox1Change"
« Reply #3 on: April 24, 2010, 03:30:46 pm »
There is a difference between code changes and user changes. IIRC the events should ony fire if the user changed something.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

bonmario

  • Sr. Member
  • ****
  • Posts: 346
Re: Assigning text to ComboBox don't fires "ComboBox1Change"
« Reply #4 on: April 24, 2010, 05:54:51 pm »
Ok. Thanks, Mario

 

TinyPortal © 2005-2018