C# text control

W

Wndr

Hi guys.
1.Just wondering if there is a way to have some kind of mask for textbox
with IP Address.

2.I have a textbox in which user has to enter some text, so is it possible
on load to add some explanation on what kind of text user should enter
inside of this textbox , and when user starts typing this text should
disappear from the textbox. For example Last Name text box should have
something like please enter your Last Name in light color.
Thanks in advance
 
W

Wndr

Thank you
Will do that.

Peter Duniho said:
Depends on what behavior you want exactly. But MaskedTextBox may do what
you want.


You can preload the TextBox instance, then handle the GotFocus event where
you can delete the text. If you want to only delete the text when the
user starts typing, you can handle KeyPress instead. In either case,
you'll probably want to keep a flag so that you delete the text only on
the first time; with the KeyPress approach, this would be critical. :)

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top