I tried to add watermark in my TextBox
. So I find a sample in msdn. But when I tried to use this Visual Studio can't find the TextBox.Background
property. How to solve it?
Asked
Active
Viewed 31 times
0

Anirban Nag 'tintinmj'
- 5,572
- 6
- 39
- 59
-
Is this a WinForms application or WPF? – eddie_cat Jun 24 '14 at 20:27
-
@Savanna It is WinForms. I've also included `PresentationFramework` and `PresentationCore` references. – Anirban Nag 'tintinmj' Jun 24 '14 at 20:28
-
2That's why. The code you are referencing uses System.Windows.Controls, not System.Windows.Forms. The WinForms textbox doesn't have a Background property. – eddie_cat Jun 24 '14 at 20:29
-
Is there anyway to do it? – Anirban Nag 'tintinmj' Jun 24 '14 at 20:32
-
1Looks like you can host WPF controls in WinForms (see http://tech.pro/tutorial/799/wpf-tutorial-using-wpf-in-winforms) I've never personally done and I think it would be better to just do the whole project WPF if you can or create a custom control. – eddie_cat Jun 24 '14 at 20:33