Visual Basic Reference

PSet Method

See Also    Example    Applies To

Sets a point on an object to a specified color.


object**.PSet** [Step] (x,y), [color]

The PSet method syntax has the following object qualifier and parts:

Part Description
object Optional. Object expression that evaluates to an object in the Applies To list. If object is omitted, the Form with the focus is assumed to be object.
Step Optional. Keyword specifying that the coordinates are relative to the current graphics position given by the CurrentX and CurrentY properties.
(x, y) Required. Single values indicating the horizontal (x-axis) and vertical (y-axis) coordinates of the point to set.
color Optional. Long integer value indicating the RGB color specified for point. If omitted, the current ForeColor property setting is used. You can use the RGB function or QBColor function to specify the color.


The size of the point drawn depends on the setting of the DrawWidth property. When DrawWidth is 1, PSet sets a single pixel to the specified color. When DrawWidth is greater than 1, the point is centered on the specified coordinates.

The way the point is drawn depends on the setting of the DrawMode and DrawStyle properties.

When PSet executes, the CurrentX and CurrentY properties are set to the point specified by the arguments.

To clear a single pixel with the PSet method, specify the coordinates of the pixel and use the BackColor property setting as the color argument.

This method cannot be used in an WithEnd With block.