Forum Discussion
AlexKaras
15 years agoChampion Level 3
Hi Saroj,
Doesn't the following code (sample from the 'Items Property' help topic) work for you?
Note that the help topic mentiones that the code works from the OnShow event, maybe control becomes read-only after being initialized?
===============
procedure UserForm1_OnShow(Sender);
begin
with UserForms.UserForm1.cxComboBox1.Properties.Items do
begin
Add('Item1');
Add('Item2');
Add('Item3');
Add('Item4');
Add('Item5');
end;
Doesn't the following code (sample from the 'Items Property' help topic) work for you?
Note that the help topic mentiones that the code works from the OnShow event, maybe control becomes read-only after being initialized?
===============
procedure UserForm1_OnShow(Sender);
begin
with UserForms.UserForm1.cxComboBox1.Properties.Items do
begin
Add('Item1');
Add('Item2');
Add('Item3');
Add('Item4');
Add('Item5');
end;
// Note that you can also use any of the following --
// Specify the comma-separated item list
// UserForms.UserForm1.cxComboBox1.Properties.Items.CommaText := 'Item1,Item2,Item3,Item4,Item5';
// Specify the item list separated by new line symbols
// UserForms.UserForm1.cxComboBox1.Properties.Items.Text :=
// 'Item1'#13#10'Item2'#13#10'Item3'#13#10'Item4'#13#10'Item5';
end;
===============
Related Content
- 4 years ago
- 5 years ago
- 11 years ago
Recent Discussions
- 19 minutes ago
- 6 hours ago