[Overview][Resource strings][Constants][Types][Classes][Procedures and functions] Reference for unit 'fpGUI' (#fpgui)

TComboBox

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The TComboBox widget is a combined button and popup list.

Declaration

Source position: combobox.inc line 64

type TComboBox = class(TCustomComboBox)

published

  property CanExpandWidth;

  

  property CanExpandHeight;

  

  property Enabled;

  

  property Text;

  

  property ItemIndex;

  

  property OnChange;

  

end;

Inheritance

TComboBox

  

The TComboBox widget is a combined button and popup list.

|

TCustomComboBox

  

|

TWidget

  

The TWidget class is the base class of all user interface objects.

|

TComponent

?

TObject

Description

A TComboBox provides a means of presenting a list of options to the user in a way that takes up the minimum amount of screen space.

A combobox is a selection widget that displays the current item, and can pop up a list of selectable items. A combobox may be editable, allowing the user to modify each item in the list.

See also

TRadioButton

  

TEdit

  

The TEdit widget is a one-line text editor

Example

{ This example shows how we can setup a static TComboBox }  
  cbStyle := TComboBox.Create(self);
  cbStyle.CanExpandWidth := True;
  cbStyle.Items.Add('Windows');           // insert items into the combobox
  cbStyle.Items.Add('WindowsXP');
  cbStyle.Items.Add('Motif');
  cbStyle.Items.Add('ClearLooks');
  cbStyle.Items.Add('OpenSoft');
  cbStyle.OnChange := @cbStyleChanged;    // setup an event handler
  cbStyle.ItemIndex := 0;                 // select the first item