[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'InterfaceBase' (#lcl)

# TWidgetSet.SetBkMode

Sets the background mix mode (transparency) of an device context.

## Declaration

Source position: winapih.inc line 240

`public function TWidgetSet.SetBkMode(`
`DC: HDC;`
`bkMode: Integer`
`):Integer; virtual;`

## Arguments

`DC` |  | The device context.
`bkMode` |  | The new background mode.

## Function result

The previous background mode, zero on failure.

## Description

The background mode specifies the handling of non-solid painting objects, like text, hatched brushes or dotted pens.

- OPAQUE mode fills the affected painting area with the background color before painting the foreground.
- TRANSPARENT mode leaves the background unchanged.