Board index » delphi » ComboBox drop down list

ComboBox drop down list

Hi, all.

Have a question concerning a ComboBox component.  How can I get the "drop
down" list to display when the combobox in accessed (OnEnter)?  This would be
without a "click" on the down arrow but would display the contents every time
the component is accessed.  It just happens to be the first component on the
form so I would like it to display it's contents when the form is accessed (or
whenever the component is clicked on).

Thanks for any help.

Eric Duran, sysop, CMPD_BBS
Eric_Du...@cmpd.mindsync.com
http://www.mindsync.com/eduran
ftp://cmpd.mindsync.com
PA-Net: 208.135.49.201 (cmpd.mindsync.com)
ICQ: 441224

 * PowerEdit 2.5 Iraqi rifle for sale.  Never fired.  Dropped once.

 

Re:ComboBox drop down list


Quote
Eric Duran wrote:

> Hi, all.

> Have a question concerning a ComboBox component.  How can I get the "drop
> down" list to display when the combobox in accessed (OnEnter)?  This would be
> without a "click" on the down arrow but would display the contents every time
> the component is accessed.  It just happens to be the first component on the
> form so I would like it to display it's contents when the form is accessed (or
> whenever the component is clicked on).

> Thanks for any help.

In D1:

In the OnEnter event handler call the DropDown method like this.

  procedure TForm1.ComboBox1Enter(Sender: TObject);
  begin
    ComboBox1.DropDown;
  end;

to close it...

procedure TForm1.CloseCombobox;
begin
DBLookupCombo1.CloseUp;
end;

Hope that helps!

Rkr
--

          \|||/
          /'^'\
         ( 0 0 )
-----oOOO--(_)--OOOo----------
Reid Roman
E-Mail : rkroman (at) pacbell (dot) net
Delphi Enthusiast, Hobbiest ..
TVisualBasic:=class(None);
U.S.A
------------------------------

Other Threads