DataControl

From Xojo Documentation
Jump to: navigation, search

Class (inherits from RectControl)

Allows the user to browse among records in a database table by clicking buttons. It consists of First Record, Previous Record, Next Record, and Last Record navigation buttons and a label that displays the Caption property. Built-in events fire when the user clicks any button. Methods allow you to navigate among rows programmatically.


Events
Close Insert MoveLast
ConstructContextualMenu KeyDown MoveNext
ContextualMenuAction KeyUp MovePrevious
Delete MouseEnter Open
DragEnter MouseExit Reposition
DragExit MouseMove Update
DragOver MouseWheel Validate
DropObject MoveFirst


Properties
Active ReadOnlyProperty.png LockBottom RecordSet ReadOnlyProperty.png
AutoDeactivate LockLeft SQLQuery
Caption LockRight Scope ReadOnlyProperty.png
Commit LockTop TabIndex
Database MouseCursor TabStop
Enabled MouseX ReadOnlyProperty.png TableName
Encoding MouseY ReadOnlyProperty.png Top
Handle ReadOnlyProperty.png Name TrueWindow ReadOnlyProperty.png
Height PanelIndex Visible
HelpTag Parent Width
Index ReadOnlyProperty.png ReadOnly Window ReadOnlyProperty.png
Left RecordLocked


Methods
AcceptFileDrop Insert RecordCount
AcceptPictureDrop Invalidate Refresh
AcceptRawDataDrop MoveFirst RefreshRect
AcceptTextDrop MoveLast Row
Close MoveNext RowCount
Delete MovePrevious RunQuery
DrawInto MoveTo SetFocus
FieldCount NewRecord Update


Notes

A DataControl is designed to display data using Checkboxes, TextFields and TextAreas, ListBoxes, Labels PopupMenus, and ComboBoxes. You can also create custom classes that are based on any of these classes and use them in conjunction with a DataControl.

Each of these controls (or their subclasses) has two properties that are specific to the DataControl: DataSource and DataField. DataSource accepts a DataControl object and DataField accepts the name of a field in the table to which the DataControl is linked. You set up a database interface by linking a DataControl to a table in a database and then linking each field whose values you wish to display to a Checkbox, TextField or TextArea, ListBox, Label, PopupMenu or ComboBox using the DataField and DataSource properties.

See Also

Database, DatabaseField, DatabaseRecord, RecordSet classes.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About