473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Restrict Label's Caption Length

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...

Regards and Thanks

Hiren
Feb 21 '08 #1
2 2606
jamesd0142
469 256MB
suppose on lable textchanged event

you could use

Expand|Select|Wrap|Line Numbers
  1. dim a as integer = len(label.text)
  2.  
  3. if a > 5 then
  4. error msg
  5. end if
  6.  
Feb 21 '08 #2
Killer42
8,435 Expert 8TB
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.
Feb 21 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Pavan Arise | last post by:
Hi all.. This may seem simple..but I am stuck here! I have a frame in which I have a label. I was trying to change the caption of that label via code (I mean at runtime & not design time). But...
4
by: Mark | last post by:
How do you reference the caption of the label attached to a control on a form by first referencing the form? For example, textbox named Addr1 has an attached label with the caption "Address1"....
4
by: Paul T. Rong | last post by:
Hello there, I have tried all day but in vain....here is the problem: Form1: there are 50 labels (so far, the number is subject to change), each label caption is a fruit or a vegetable, for...
7
by: Rab | last post by:
hi i need to programmatically change the caption of a label that is linked to another control (i.e. textbox, combobox). it's for a generic function where i only know the textbox/combobox name...
6
by: Joe | last post by:
I know that the Literal control will not render a <span> tag so I can not format its text. Other than this, what is the difference betwen the Literal control and the LiteralControl Control? How...
0
by: Mark | last post by:
I want to create a user control inherited from a TextBox with an associated label (let's call it a LabelTextBox). The trick is that I want the control to inherit from TextBox and have all of its...
5
by: dgardner | last post by:
This one has me stumped and I hope someone can help. I have a form with a button on it. When I click the button, I want a label named lblWait to be visible. (When the form opens, the label is...
0
by: gobblegob | last post by:
Well i cannont remember where i picked this code up, but i have seen it asked for in many forums, Many times so i thought i'd add it here (Since this is my favourite forum). Auto scroll text in...
0
by: JuAn2226 | last post by:
Hi, can someone help me with the coding. I want to update the label TimeStart and label TmeEnd every 5 min. Can someone show how to do it. In this pogrom the label TimeStart only display first time...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.