Articles in this section
Category / Section

How to provide water mark text appearance using WinForms BannerTextProvider?

2 mins read

This following step guide to implement Water mark support using BannerTextProvider.

 

1)Drag and drop the BannerTextProvider to the form.

 

    BannerTextProvider in Toolbox

     Figure 1. BannerText Provider in ToolBox.

 

2)The controls loaded in the form will get a BannerTextProvider properties as shown in below.

 

     BannerTextProvider property in ComboBoxAdv

       Figure 2. BannerText Provider Properties in ComboBoxAdv.

 

The following code example demonstrates the same.

C#

//BannerTextProvider for TextBoxExt
Syncfusion.Windows.Forms.BannerTextInfo bannerTextInfo1 = new Syncfusion.Windows.Forms.BannerTextInfo();
bannerTextInfo1.Mode = Syncfusion.Windows.Forms.BannerTextMode.EditMode;
bannerTextInfo1.Text = "Enter text here";
bannerTextInfo1.Visible = true;
//Associate the BannerTextProvider with TextBoxExt.
this.bannerTextProvider1.SetBannerText(this.textBoxExt1, bannerTextInfo1);
 
// BannerTextProvider for ComboBoxAdv
Syncfusion.Windows.Forms.BannerTextInfo bannerTextInfo2 = new Syncfusion.Windows.Forms.BannerTextInfo();
bannerTextInfo2.Mode = Syncfusion.Windows.Forms.BannerTextMode.EditMode;
bannerTextInfo2.Text = "Choose any item";
bannerTextInfo2.Visible = true;
//Associate the BannerTextProvider with ComboBoxAdv.
this.bannerTextProvider1.SetBannerText(this.comboBoxAdv1, bannerTextInfo2);

 

VB

'BannerTextProvider for TextBoxExt.
Dim bannerTextInfo1 As New Syncfusion.Windows.Forms.BannerTextInfo()
bannerTextInfo1.Mode = Syncfusion.Windows.Forms.BannerTextMode.EditMode
bannerTextInfo1.Text = "Enter text here"
bannerTextInfo1.Visible = True
'Associate the BannerTextProvider with TextBoxExt.
Me.bannerTextProvider1.SetBannerText(Me.textBoxExt1, bannerTextInfo1)
 
' BannerTextProvider for ComboBoxAdv.
Dim bannerTextInfo2 As New Syncfusion.Windows.Forms.BannerTextInfo()
bannerTextInfo2.Mode = Syncfusion.Windows.Forms.BannerTextMode.EditMode
bannerTextInfo2.Text = "Choose any item"
bannerTextInfo2.Visible = True
'Associate the BannerTextProvider with ComboBoxAdv.
Me.bannerTextProvider1.SetBannerText(Me.comboBoxAdv1, bannerTextInfo2)

 

BannerTextProvider shows in TextBoxExt

 Figure 1. BannerTextProvider shows in TextBoxExt.

BannerTextProvider shows in ComboBoxAdv

Figure 2. BannerTextProvider shows in ComboBoxAdv.

Sample Links:

C#: BannerTextProvider_C#

VB: BannerTextProvider_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied