TComboBox: Assigning a value to the Text property can be incorrect before the form is activated
Original Reporter info from Mantis: Kolomensky
-
Reporter name: Kolomensky
Original Reporter info from Mantis: Kolomensky
- Reporter name: Kolomensky
Description:
TComboBox: Assigning a value to the Text property can be incorrect before the form is activated.
The problem occurs if there is an Item in the Items list for which Upcase (Item) = Upcase (Text), but Item <> Text
Steps to reproduce:
put a ComboBox on a Form.
add FormCreate
procedure TForm1.FormCreate(Sender: TObject);
begin
ComboBox1.AddItem('abcdE',nil);
ComboBox1.Text:='ABCDE' ;
end;
run it
Having as Result on form: "abcdE"
alternatively with FormActivate
procedure TForm1.FormCreate(Sender: TObject);
begin
ComboBox1.AddItem('abcdE',nil);
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
ComboBox1.Text:='ABCDE' ;
end;
Run It and we have as Result on form: "ABCDE"
Additional information:
This was tested on Lazarus 2.0.2 too.
This problem also applies to TDBComboBox.
Mantis conversion info:
- Mantis ID: 37284
- OS: Windows 7
- Build: 62944
- Version: 2.0.8