TCombo Box Drop Down
Posted: Tue Aug 26, 2008 10:03 pm
Using the RVEdit Demo that comes with the ScaleRichView component I have been playing around with adding a combo box into the RichView document (The Readme.rvf that comes with the example).
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:
Now the combo box will appear and I am able to select between left and right options however the drop down list does not appear under the combo box.
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?
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?