Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display caption in input field C# [duplicate]

Tags:

c#

winforms

Possible Duplicate:
Watermark TextBox in WinForms

I'm currently programming the settings dialog of a C# application. The input fields should look like that:

Input field emptyInput field filled out

What's the best way to realize that? I've thought of creating a background-image but I would like to know if there's a better way to do that (something dynamically)...

like image 572
libjup Avatar asked Oct 31 '25 15:10

libjup


1 Answers

Use a panel with white set as the BackColor.
In the panel control, on the left insert a TextBox with BorderStyle set to None.
In the panel control, on the right insert a Label with BackColor set to Transparent and set Text to "Firstname".

enter image description here

like image 65
Hassan Boutougha Avatar answered Nov 03 '25 05:11

Hassan Boutougha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!