Watermark in Windows Forms ComboBox (SfComboBox)
3 Sep 2020 / 1 minute to read
Null value
Watermark text can be shown in the SfComboBox control by setting the AllowNull property to true
. If the value is null and the editor portion of the control is empty, the watermark will be displayed as text in the SfComboBox control. The default value of AllowNull
is false
.
sfComboBox1.AllowNull = true;
sfComboBox1.AllowNull = True
Appearance
Watermark text can be changed by setting value to the Watermark property. Watermark fore color can be changed by setting value to the WatermarkForeColor
property. The default watermark text is None
.
sfComboBox1.Watermark = "Choose a US State";
sfComboBox1.Style.EditorStyle.WatermarkForeColor = Color.Blue;
sfComboBox1.Watermark = "Choose a US State"
sfComboBox1.Style.EditorStyle.WatermarkForeColor = Color.Blue
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page