HypernovaDesktop Components · docs
Binarymission
WinFormsWatermark Text Box › WatermarkProvider

WatermarkProvider

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.InputControls

Draws the watermark shown over a control while it is empty, using a label for the watermark text and a picture box for the watermark image.

public sealed class WatermarkProvider : WatermarkControlProvider

Inherits from / implements: WatermarkControlProvider

Members at a glance

WatermarkProviderInitializes a new instance of the WatermarkProvider class.
ShouldRenderWatermarkImageWhether the image part of the watermark is drawn. Text-only watermarks leave it false.
WatermarkImageThe image drawn as the watermark, or null for a text-only watermark.
WatermarkImageSizeThe size the watermark image is drawn at.
WatermarkTextThe text drawn as the watermark while the control is empty.
OnSizeChangedRaises the SizeChanged event. The provider overrides it because its two children were positioned only when the watermark image changed, so a text-only watermark - the ordinary case - was laid out once at construction and never again.

Constructors

WatermarkProvider

public WatermarkProvider()

Initializes a new instance of the WatermarkProvider class.

Properties

ShouldRenderWatermarkImage

public override bool ShouldRenderWatermarkImage

Whether the image part of the watermark is drawn. Text-only watermarks leave it false.

WatermarkImage

public override Bitmap WatermarkImage

The image drawn as the watermark, or null for a text-only watermark.

WatermarkImageSize

public override Size WatermarkImageSize

The size the watermark image is drawn at.

WatermarkText

public override string WatermarkText

The text drawn as the watermark while the control is empty.

Methods

OnSizeChanged

protected override void OnSizeChanged(EventArgs e)

Raises the SizeChanged event. The provider overrides it because its two children were positioned only when the watermark image changed, so a text-only watermark - the ordinary case - was laid out once at construction and never again.

e
The data for the event.