Limit Text in Textbox

T

thewhoracle

I was wondering if there was an easy way to limit how many characters
appear in a text box even when i set the text from code, instead of
typing it in? MaxLength only seems to control me actually typing into
the field. is there a way around that, or do i just have to chop fdown
my string in VB before entering it?
 
M

Mona

Hi,

You can expose the text property of your custom textbox control as a public
property and then perform your text length validations in the set subsection
of the property's code. In case the length of the text is larger than
expected, you can either throw an error or simply truncate the text being
entered.

HTH

Mona[Grapecity]
 

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

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top