How to use Dbedit components in Delphi

Source: Internet
Author: User

The Dbedit component of Delphi is located on the data controls page of the palette, which is used to edit the value of a field currently recorded in the datasheet. The main properties and methods of the Dbedit component are as follows:

1. Main properties

(1) DataSource

Use to select a data source so that the Dbedit component connects to the datasheet through a data source. When Dbedit is connected to a data table through a data source, it is determined by the DataField field to display which field of the datasheet.

(2) DataField

Used to select a data field, and if DataField is set to TB0602, Dbedit is used to display values that are TB0602 with the edit field.

DataSource and DataField are the 2 most important properties that data interface components use to select data tables and fields.

(3) Enabled

When enabled is true, the data interface component is valid, and the component can be used for editing operations. When enabled to false, the data interface component is invalid, and the component is grayed out after it is run and cannot be manipulated with the mouse or keyboard.

(4) ReadOnly

When ReadOnly is true, the data can only be read and cannot be modified, or false, and the data can be read and writable. The default value is False.

These properties are also common to most data interface components, so in the following component descriptions, the above properties are not repeated.

2. Main methods

(1) OnChange

This event is triggered when the field contents are changed.

(2) OnClick

Click the component with the mouse to trigger the event.

(3) OnDblClick

The event is triggered by double-clicking the component with the mouse.

(4) OnKeyDown

This event is triggered when the key is pressed.

(5) OnKeyUp

This event is triggered when the key is released.

(6) OnMouseDown

This event is triggered when the mouse is pressed.

(7) OnMouseUp

This event is triggered when the mouse is released.

Readers should note that the above method is also the majority of data interface components common method, we can try to write a small program, so you can grasp.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.