Class BannerTextProvider.TextBoxExtender
Renders banner text for System.Windows.Forms.TextBox-derived control.
Inheritance
Namespace: Syncfusion.Windows.Forms
Assembly: Syncfusion.Shared.Base.dll
Syntax
public class TextBoxExtender : NativeWindow
Constructors
TextBoxExtender(BannerTextInfo, IExtendableTexBox)
Initializes a new instance of the BannerTextProvider.TextBoxExtender class using the specified banner text information and extendable text box.
Declaration
public TextBoxExtender(BannerTextInfo info, IExtendableTexBox etb)
Parameters
| Type | Name | Description |
|---|---|---|
| BannerTextInfo | info | The BannerTextInfo containing banner text configuration. |
| IExtendableTexBox | etb | The IExtendableTexBox to be extended with banner text functionality. |
Properties
ETB
Gets the IExtendableTexBox associated with this extender.
Declaration
public IExtendableTexBox ETB { get; }
Property Value
| Type |
|---|
| IExtendableTexBox |
Font
Gets the font used by the banner text provider, optionally overriding the font family if allowed.
Declaration
public Font Font { get; }
Property Value
| Type |
|---|
| System.Drawing.Font |
IsTextEmpty
Gets a value indicating whether the associated text box currently has no text.
Declaration
protected bool IsTextEmpty { get; }
Property Value
| Type |
|---|
| System.Boolean |
ShouldDrawBanner
Gets a value indicating whether the associated text box currently has no text.
Declaration
protected bool ShouldDrawBanner { get; }
Property Value
| Type |
|---|
| System.Boolean |
Methods
DrawBannerText(Graphics, BannerTextInfo, Color, Font, RightToLeft, Rectangle)
Draws banner text.
Declaration
public static void DrawBannerText(Graphics g, BannerTextInfo info, Color bgColor, Font font, RightToLeft rtl, Rectangle clientRect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | System.Drawing.Graphics to draw at. |
| BannerTextInfo | info | Specifies banner text appearance. |
| System.Drawing.Color | bgColor | Banner text background color. |
| System.Drawing.Font | font | Fallback font for the case when doesn't contain valid font. |
| System.Windows.Forms.RightToLeft | rtl | Text flow layout. |
| System.Drawing.Rectangle | clientRect | Rectangle to draw within. |
IsBannerTextVisible(BannerTextInfo, Boolean, Boolean)
Determines whether draw text is visible and must be drawn.
Declaration
public static bool IsBannerTextVisible(BannerTextInfo info, bool bFocused, bool bEmptyText)
Parameters
| Type | Name | Description |
|---|---|---|
| BannerTextInfo | info | Describes banner text appearance. |
| System.Boolean | bFocused | Indicates whether extended text box is focused. |
| System.Boolean | bEmptyText | Indicates whether extended text box's text is empty. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if banner text is visible. |
OnHandleChange()
Called when the handle of the control changes. This override currently delegates to the base implementation but can be extended for custom handle-related logic.
Declaration
protected override void OnHandleChange()
OnPaint(Graphics)
Handles the paint event to draw banner text on the associated text box.
Declaration
protected virtual void OnPaint(Graphics g)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | The System.Drawing.Graphics object used for rendering. |
ReleaseHandle()
Releases the handle associated with the control, unsubscribes event handlers, and clears references to associated objects to prevent memory leaks.
Declaration
public override void ReleaseHandle()
WndProc(ref Message)
Overrides the window procedure to handle specific Windows messages such as WM_PAINT, WM_SETFOCUS, and WM_KILLFOCUS. Custom painting and invalidation logic is applied when the control is visible and associated objects are initialized.
Declaration
protected override void WndProc(ref Message m)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Forms.Message | m | The Windows message to process. |