I did the following
1) On the Insert -> Component sub menu I added a new Menu Item for "Combo Box"
2) In the on Click for this event I added the following code:
Code: Select all
procedure TForm1.miInsertComboBoxClick(Sender: TObject);
var
cb: TComboBox;
begin
cb := TComboBox.Create(nil);
srv.RichViewEdit.InsertControl('ComboBox1', cb, rvvaAbsMiddle);
cb.Style := csDropDownList;
cb.Items.Text := 'Left'#13'Right';
if srv.RichViewEdit.CurItemStyle = rvsComponent then
srv.RichViewEdit.SetCurrentItemExtraIntProperty(rvepResizable, 1, True);
cb.OnClick := OnControlClick;
end;
Instead when I click on the combo box the list appears over to the left and either above or below the box depending on it's screen position.
What am I missing? How do I make it appear under the box itself?