class PaintBox
A generic control that can be placed on a form.
Syntax
[<oRef> =] new PaintBox(<container> [,<name expC>])
<oRef>
A variable or property—typically of <container>—in which to store a reference to the newly created PaintBox object.
<container>
The container—typically a Form object—to which you’re binding the PaintBox object.
<name expC>
An optional name for the PaintBox object. If not specified, the PaintBox class will auto-generate a name for the object.
Properties
The following tables list the properties and events of interest in the PaintBox class. (No particular methods are associated with this class.)
Property |
Default |
Description |
false |
Whether dragged objects can be dropped in the PaintBox | |
PAINTBOX |
Identifies the object as an instance of the PaintBox class | |
(PAINTBOX) |
Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName | |
BtnText/BtnFace |
The color of the paintbox | |
false |
Whether the paintbox background is the same as the background color or image of its container
| |
Event |
Parameters |
Description |
<char expN>, |
After a non-cursor key or key combination is pressed | |
|
After the form containing the PaintBox object has been closed |
<left expN> |
When the mouse enters the paintbox display area during a Drag&Drop operation | |
|
When the mouse leaves the paintbox display area without having dropped an object | |
<left expN> |
While the mouse drags an object over the paintbox display area during a Drag&Drop operation | |
<left expN> |
When the mouse button is released over the paintbox display area during a Drag&Drop operation |
|
After the form containing the paintbox is resized | |
<char expN>, |
After any key is pressed | |
<char expN>, |
After any key is released | |
|
Whenever the paintbox needs to be redrawn
|
The following table lists the common properties, events, and methods of the PaintBox class:
Description
The PaintBox object is a generic control you can use to create a variety of objects. It is designed for advanced developers who want to create their own custom controls using the Windows API. It is simply a rectangular region of a form that has all the standard control properties such as height, width, and before, as well as all the standard mouse events.
In addition to the standard events or properties, the PaintBox object has three events that let you detect keystrokes entered when it has focus: onChar, onKeyDown, and onKeyUp. These let you create customized editing controls. The onPaint and onFormSize events let you modify the appearance of the object based on user interaction.