Help Menu

KaioneSoft Home

Help Home

Index

Glossary

Conventions

Introduction

Installation

Getting Started

SprintDB Pro 2

Desktop Companion

Using Tables

Creating SQL

Creating Forms

Controls »

Advanced Techniques

Understanding Macros

Macro Actions

Database Functions

Tutorial

UI Design Guide

New Features

How to Work with Controls

Creating a control

  1. In the form edit mode.
  2. Tap Insert menu and select control type you want to create.
  3. Tap any blank area of the form background to place it.

Selecting a Control

To select a control, tap on it with the stylus. This will display the "Resizing Handles" (the little squares at the four corners and in the middle of the object), allowing you to move the control around the form or select a handle and alter its size.

Selecting Multiple Controls

You can also select multiple controls simultaneously.

  1. Tap and hold the stylus and "draw" a rectangle around the required controls.
  2. Lift the stylus.
  3. You can also select multiple controls by using the Ctrl key. Tap the InputPanel Ctrl key first, and then tap the required controls.
  4. Tap and hold the selected controls and move them where required.
  5. To un-select, tap anywhere on the form.

Micro-adjustment

You can fine tune the placement of a selected control or multiple controls by using the Control Placement arrows. Tapping these buttons allows you to move selected items one pixel at a time.

You can resize a control one pixel at a time by holding down the SHIFT key and using the ARROW keys.

Setting the SprintDB Pro controls's porperties

  • Select a control(s) first.
  • Tap the Tools > Control Properties menu item, or tap .

Supported SprintDB Controls

Common properties for SprintDB controls

The Basic Properties:

  • Form: Specify which form the control belong to. If there's no SubForm on your form, it should be MainForm. If you are using a SubForm(s) on your form, set Form property to appropriate SubForm(SubForm1 to SubForm5).
  • Name: The name of the control. All controls on SprintDB form must have a unique name.
  • Caption: Specifies the text displayed on the control.
  • Color: The background color of the control.
  • Font: Specify the font will be used in the control with font color.
  • Visible: Determines if the control will be visible at run time.
  • Locked: Indicates whether a control can be edited. When Locked is set to Yes, a user cannot change any data.
  • Alignment: Determines how the text in the control is to be aligned.
  • Border: Determines whether the control has a border around it.
  • TapStop: Indicates whether the user can give the focus to the control using the TAB key.
  • Left/Top/Width/Height: The controls' position and dimension in pixel.

The Data Properties:

  • ControlSource: Specify the control source to which the control is bound. The ControlSource expression is a specification of a relationship between the control and the table fields, form controls, and other user data. The ControlSource expression is a combination of table field names, form control names, constants, and functions connected by an operator(s). A bound control's ControlSource is a single table field name. (e.g: table1.field1) A calculated control's ControlSource can be a combination of table field names, form field names, constants, and functions connected by an operator(s). (e.g: table1.field1+DateDiff(d,table1.date1,table1.date2)).
  • DefaultValue: Specify a value that is automatically entered in a field when a new record is created. For example, 345, SYSDATE(), "Hello", "Hello "+@Gvar0.
  • ValidationRule: Determines whether or not a control contains valid data. You can use any boolean expresson to validate the data. For example, &thisControl<>NULL, &thisControl>=100 AND &thisControl<=200. When data is entered that violates the ValidationRule setting, you can use the ValidationText property to specify the message to be displayed to the user.
  • ValidationText: Any string expression. For example, "Enter a nonzero value".

The Event Properties:

  • BeforeUpdate/AfterUpdate event: The BeforeUpdate event occurs before changed data in a control is updated. AfterUpdate event occurs after changed data in a control or record is updated. When you enter new or changed data in a control on a form and then move to another record or move to another control on the form, the BeforeUpdate and AfterUpdate events for the control occur for the control.
  • OnClick: The OnClick event occurs when you click a control.  
  • OnDblClick: The OnClick event occurs when you double-click a control.  
  • OnGotFocus: The OnGotFocus event occurs when a control receives the focus.
  • OnLostFocus: The OnGotFocus event occurs when a control loses the focus.

EditBox

A control that provides a place to enter or view text in a form. Edit boxes can hold multiple lines of text.

The Basic Properties:

  • Format: Specify the way numbers are displayed. You can use one of the predefined formats: Number, Currency and Percent.
  • MaxChars: Specify the maximum amount of text that the edit control can accept. It has no effect on any text already in the edit control, nor does it affect the length of the text copied to the edit control by the SetControl() macro action. 
  • DateTimePicker: Determines whether the EditBox can be used to choose Dates and/or Times from the pop-up Calendar or Dialog box.
  • Password: If you set Password property to Yes, any character typed in the control is stored as the character but is displayed as an asterisk (*).
  • Extendable: Extendable property allows you to create a edit box that has an extension button. Enter the required number of lines. Line number "0" disables this option.
  • AutoHScroll: When set to "Yes" the text in the editbox scrolls horizontally when the length of a line is greater than the width of the control.
  • V.Scroll: When set to "Yes" will add vertical scroll bars to the control.
  • PrintBarcode: SprintDB Pro+Printing version only. Specify the barcode type if you want to print the text in the control as barcode, not text.

The Event Properties: 

  • OnChange event: The OnChange event occurs when the text in the control has changed.

Button

A control that is associated with a command. When you click a button at run time, the command associated with the button executes.

CheckBox

A control that indicates whether an option is on or off. A checkmark appears in the box when it is selected. The CheckBox control is used to retrieve a logical (Yes/No, True/False) value from a Table.

Label

A label is used to display text. A label control does not accept user input.

List (Grid control)

The list control provides a visual interface to display data in table form, and is divided into rows and columns.

The Basic Properties:

  • FulRowSelect: Specifies if the entire row is selected. To enable in-cell editing, set to No.
  • AutoSizeColumn: Specifies whether columns are automatically resized to fit its content at run-time. To manually specifies the width of columns, set to No, and adjust column width on form edit mode.

The Data Properties:

  • ControlSource
  1. Tap the [...] button to open the "List Editor" window. This is where you will construct your list structure.
  2. In the Column field, enter the Name you want to appear on the head of the List column. This can be a different name than the Fieldname of the table.
  3. In the Expr (Expression) field, enter expression you want to use. The easiest way to do this is to select the tablename from the Table dropdown box, then choose the field from the Field dropdown box.
  4. If required, you can then select a Function and a Control.
  5. When finished, tap the [+] button beneath the Expr field. This adds the completed expression to the list.
  6. To specify the data display format for a column, select the column from the list and then tap [Format] button.
  7. To specify text alignment in a column, select the column first, and then choose Left/Right/Center.
  8. To add another expression, repeat steps 2 - 7.
  9. To update column or expression, tap the [*] button.
  10. To remove a column, tap the [-] button.
  11. To move a row up, tap the Up button. Tap the Dn button to move it down the list.

Related control properties:

DropdownBox (ComboBox)

A control, similar to a list box and edit box combined, in which you enter a value or select a item from a list.

The Basic Properties:

  • Distinct: To remove duplicates in your DropdownBox, set to "Yes".
  • Style: Specifies the type of combo box. "Dropdown" - edit box of the combo box takes user input, and the list is not displayed unless the user clicks a drop-down arrow at the right of the edit box control. "DropList" - the edit box does not take user input.

The Data Properties:

  • RowSourceType: Allows you to set whether to use a Table or a Query to populate the DropdownBox or a list of manually entered values, called a "ValueList".
  • RowSource: Allows you to enter a SQL statement or a value list.
  • ColumnCount: The number of the column returned by the RowSource. It always 1 when RowSource is set to ValueList.
  • BoundColumn: Identifies which column to store as the value of the DropdownBox.
  • VisibleColumn: Identifies which column to display in the DropDownBox.
  • OutputExpr: Any string expression that specify how to display the column returned by the RowSource. It's useful when the ColumCount is more than 2.

Example 1:

RowSourceType: Table/Query

RowSource: SELECT Customers.ID, Customers.CompanyName FROM Customers

ColumnCount: 2

BoundColumn: 1

VisibleColumn: 2

OutputExpr

Example 2:

RowSourceType: Table/Query

RowSource: SELECT Customers.ID, Customers.CompanyName, Customers.PhoneNumber FROM Customers

ColumnCount: 3

BoundColumn: 1

VisibleColumn:

OutputExpr: Customers.CompanyName+"-"+Customers.PhoneNumber

Related macro actions:

Tab control

A tab control provides a user interface similar to Windows tabbed dialog boxes. Users switch between pages by clicking the corresponding tab on the top of the page. A Tab control is the easiest and most effective way to create a form with multiple pages.

Note: To select a Tab control, you need to Double-tap on it.

You can place any SprintDB Pro controls(except another Tab control)  on a Tab control.

  1. Create the control in the normal way from the Insert menu
  2. To place the control, tap on the active Tab
  3. Position the control by tapping and hold it and dragging into position.

Inserting a New Tab:

  1. Double-tap the Tab control to select it
  2. Tap the Tools > Tab Control > Insert Page menu item. This will add a Tab with a default "Page #" caption.

Deleting a Tab:

  1. Double-tap the Tab control to select it
  2. Tap the Tools > Tab Control > Remove Page menu item. This will remove the currenly selected Tab.

The Basic Properties:

  • TabPosition: The options are: "Top", "Bottom", "Left" or "Right".
  • TabBkColor: Specify the background color of the tab.
  • TabColor: Specify the color of the tab page.
  • PageName: Enter a PageName for the selected PageIndex. This is the caption that will appear on the Tab.

The Event Properties:

  • OnSelChange: The OnSelChange event occurs when the currently selected tab has changed.

Related control properties:

  • FocusTab() Set/Get the currently selected tab page in a list control.

PictureBox

A picturebox control allows you to include image files (BMP and JPG formats) in your database applications. A PictureBox control can be bound to a Text Type table field that contains the file path of the image file. You can also specify a fixed path of an unbound PictureBox, using the FixedPath property.

The Basic Properties:

  • Stretch: Specifies how an image is sized to fit inside a control.
    • Stretch: The image resizes to fit the control, but does not maintain its original proportions.

    • Zoom: The image resizes to fit the control while maintaining its original proportions.

The Data Properties:

  • FixedPath: Specifies a fixed path of a image file for an unbound PictureBox control.

ScribbleBox

A ScribbleBox control allows you to draw pictures using your stylus. The Scribble control can be bound to an OLEObject table field. Then SprintDB Pro saves your drawing to the underlying field as a BMP format.

Related macro actions:

Tree control

A tree control is a control that displays a hierarchical list of items.

Each item consists of a label, and each item can have a list of subitems associated with it. By clicking an item, the user can expand and collapse the associated list of subitems.

The Event Properties:

  • OnSelChange: The OnSelChange event occurs when the selection has changed from one item to another.

Related macro actions:

Related control properties:

See also: UI Design Guide

    <Top>