Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Visual Basic only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
Visual Basic
Restrict Label's Caption Length
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Hiren Joshi
New Member
Join Date:
Feb 2008
Posts:
30
#1
Restrict Label's Caption Length
Feb 21 '08, 01:49 PM
Is it possible to Restrict Label's Caption like up to 4 or 5 characters? e.g. the way we restrict Text Box by Setting MaxLength...
Regards and Thanks
Hiren
jamesd0142
Contributor
Join Date:
Sep 2007
Posts:
471
#2
Feb 21 '08, 02:21 PM
suppose on lable textchanged event
you could use
[code=text]
dim a as integer = len(label.text)
if a > 5 then
error msg
end if
[/code]
Comment
Post
Cancel
Killer42
Recognized Expert
Expert
Join Date:
Oct 2006
Posts:
8429
#3
Feb 21 '08, 09:38 PM
Originally posted by
Hiren Joshi
Is it possible to Restrict Label's Caption like up to 4 or 5 characters? e.g. the way we restrict Text Box by Setting MaxLength...
Since the label is not editable in the way a textbox is, why would you want to?
The only way for a value to get there would be if your code put it there, so just don't put in a caption longer than what you want.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment