Skip to content

TWebStretchPanel

Description

Below is a list of the most important properties methods and events for TWebStretchPanel. The TWebStretchPanel is a container control with a top and bottom area. The height of the bottom area has a fixed height while the top area height can adapt itself to the height of controls (when controls are relatively positioned in the top area). When a control is put in the upper area at design-time, it will belong at runtime in the upper stretching area of the TWebStretchPanel. When a control is put in the lower area, it will belong to the lower fixed height area and will as such automatically appear lower when the upper panel area is stretched to fit the controls in the upper area.

Designtime Runtime

Example:

A TWebListBox and TWebButton is placed on the TWebStretchPanel. The button is on the lower part, the listbox on the upper part. From the button, items are added to the listbox and the height of the listbox is increased. This causes the upper part to stretch to the height of the listbox and the button remains below the stretched upper area in the fixed height area of the lower part:

procedure TSampleForm.WebButton1Click(Sender: TObject);
var
  i: integer;
  begin
    for i := 0 to 20 do
    begin
      WebListbox1.Items.Add('item '+inttostr(i));
    end;
    WebListbox1.Height := 300;
end;

HTML template tag

The HTML tag the component can be associated with in an HTML template. Assign the ID attribute with a unique value and set the identical value to the ElementID property. Detailed information can be found in the Use of HTML templates topic.

HTML tag <DIV ID=”UniqueID”></DIV>
ElementID UniqueID

Properties for TWebStretchPanel

Property Description
ElementClassName Optionally sets the CSS classname for the label when styling via CSS is used
ElementID Optionally sets the HTML element ID for a HTML element in the form HTML file the label needs to be connected with. When connected, no new label is created but the Delphi class is connected with the existing HTML element in the form HTML file
FixedHeight Sets the fixed height of the bottom area in the panel.

Events for TWebStretchPanel

Event Description
OnClick Event triggered when the groupbox is clicked
OnDblClick Event triggered when the groupbox is double-clicked
OnMouseDown Event triggered when the mouse is down on the panel
OnMouseMove Event triggered when the mouse moves over the panel
OnMouseUp Event triggered when the mouse goes up on the panel