Search:     Advanced search

function NewComboBox(Left, Top, Text = "")

Article ID: 318
Last updated: 24 Sep, 2010
Views: 843
Posted: 30 Dec, 2008
by Thomas B.
Updated: 24 Sep, 2010
by Murray D.

Description:

Creates a new drop-down combo box. (Returns an object of class TComboBox.)

Notes:

Parameters

Left (This is an integer value for the left position of the combo box on the form.)

Top (This is an integer value for the top position of the combo box on the form.)

Text (This is a string value for the default combo box text.)

This would create a combo box on a sample form with the default value of Item 1, and possible drop-down values of Item 1, Item2, and Item 3.  The user will also be able to type a custom value (regardless of what options are in the drop-down), similar to an edit box.  Copy and paste the code into a New PlanSwift Script.

Pascal Example:

Form := NewForm(230, 150, 'Sample Form');
NewLabel(26,23,'Name:');
Spacing := NewComboBox(24,48,'Item 1');
Spacing.Items.Add('Item 1');
Spacing.Items.Add('Item 2');
Spacing.Items.Add('Item 3');

if Form.ShowModal <> mrOk then
  Exit;

Visual Basic Example:

Form = NewForm(230, 150, "Sample Form")
NewLabel(26,23,"Name:")
Spacing = NewComboBox(24,48,"Item 1")
Spacing.Items.Add("Item 1")
Spacing.Items.Add("Item 2")
Spacing.Items.Add("Item 3")

if Form.ShowModal <> mrOk then
  Exit Function
end if


Enterprise and Developer editions

This article was:  
Prev  Not what you're looking for? Suggest a topic  Next
function NewColorBox(Left, Top)     Global Routines & Variables