Change of cursor position in Text.

manasi

Member
Joined
Jul 19, 2006
Messages
15
Programming Experience
Beginner
Hi All !!

I have created a customized Textbox control, by setting the default text as " / / ", (as I am setting it for date format in the form of "mm/dd/yy"). After running code, while entering the text in this customized textbox, I want the cursor position to get passed after each slash ( " / " ) , so as to enter the text further. So how to set the cursor position in the text?

It would be nice to receive responses :) !!

Thank you,
Manasi
 
You are trying to reinvent the MaskedTextBox control. Of course you are allowed to do this. :) but in case you didn't know of it before, know you know such a control already exist in .Net framework.
 
Hi John !!
Nice to receive reply.. Thank you for the same !
But am sorry, I couldn't find any kind of MaskedTextBox control, and I have .net Framework of 2.0 version..
As I am new to VB.NET,can u please explain in details..

THanks,
Manasi
 
It's listed in the Toolbox category Common controls. Thorougly documented in the .Net Framework reference, also available online at MSDN.
 
Hi,

I got the MaskedTextBox control....but the text is not editable at all... I have set the format and also mask for that control
Then explicitly, in code I tried to to make the text editable..but its not working at all.. :(
 
vis781, that was a control made before .Net 2.0 provided one default.

manasi, you should read the documentation for MaskedTextBox if you don't understand it. I don't know how you make it uneditable, perhaps you set it ReadOnly? Perhaps you set wrong mask? Sounds as your Mask should be "00/00/00". Cursor position in text regarding mask literals is handled by the control automatically.
 
Back
Top