all groups > vb.net controls > july 2004 >
You're in the

vb.net controls

group:

Formatted TextBox



Formatted TextBox Daniel Billingsley
7/31/2004 9:34:22 AM
vb.net controls: I'm considering writing a custom TextBox that works similar to the 3rd party
controls.

Let's say I want to display "##/##/####" by default and when the user enters
"04" I want to jump the cursor over the "/" and land it on the next "#".
And vice versa if backspace is pressed. Hope that's clear.

There doesn't seem to be a property of the TextBox that gives the current
cursor position. Without that I think I'd be left to trapping keystrokes
and keeping track of it all myself. In that case I may just go shopping at
the 3rd party controls.

Any thoughts or help?

Re: Formatted TextBox Ken Tucker [MVP]
7/31/2004 1:07:12 PM
Hi,

http://www.thecodeproject.com/vb/net/maskedbox_control.asp

Ken
-----------------------
[quoted text, click to view]
I'm considering writing a custom TextBox that works similar to the 3rd party
controls.

Let's say I want to display "##/##/####" by default and when the user enters
"04" I want to jump the cursor over the "/" and land it on the next "#".
And vice versa if backspace is pressed. Hope that's clear.

There doesn't seem to be a property of the TextBox that gives the current
cursor position. Without that I think I'd be left to trapping keystrokes
and keeping track of it all myself. In that case I may just go shopping at
the 3rd party controls.

Any thoughts or help?


Re: Formatted TextBox hirf-spam-me-here NO[at]SPAM gmx.at
8/2/2004 7:51:59 AM
* "Daniel Billingsley" <dbillingsley@NO_durcon_SPAAMM.com> scripsit:
[quoted text, click to view]

<URL:http://www.codeproject.com/cs/miscctrl/maskedcsedit.asp>
<URL:http://www.codeproject.com/vb/net/maskedbox_control.asp>
<URL:http://www.codeproject.com/vb/net/validtext3.asp>
<URL:http://www.codeproject.com/vb/net/cpflexmaskeditbox.asp>
<URL:http://www.codeproject.com/useritems/ValidText.asp>
....

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
AddThis Social Bookmark Button