473,406 Members | 2,336 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,406 software developers and data experts.

masked textbox control with error provider control

107 100+
Hello,
I have a texbox with error provider control:
Expand|Select|Wrap|Line Numbers
  1. if(textbox.text.length <=0)
  2. {
  3.      errorprovider1.seterror(textbox,"enter part number");
  4. }
  5. else
  6. {
  7.      errorprovider1.seterror(textbox, "");
  8.  
Now when I use this code on masked textbox does not work- I am trying to change if statement to work
thank you
Jun 13 '09 #1
3 5458
tlhintoq
3,525 Expert 2GB
Now when I use this code on masked textbox does not work
What do you mean by "does not work"? If it doesn't function then you should have an error/exception message.
Or is it working (no error) just not behaving as you thought it would?

It's simple enough to see *why* it does what it does/thinks what it thinks, and see if your assumptions are right.
  • Put a breakpoint on line 1.
  • When the code stops there, walk through line by line with F-10.
  • Check the values of your assumptions.

Having the 'locals' and 'auto' pallets open will show you those variables and their values.

Hovering the mouse over a code segment such as textbox.text will show you it's value.

Your 'if' construct is centered on the assumption that the textbox.text will be empty: So confirm that. When it breaks on that line, hover your mouse over the textbox.text and see what its value really is. You might be surprised to find out that it isn't blank.
Jun 14 '09 #2
buddyr
107 100+
your right i did not communicate problem.
statement works - just not giving results I want

your right its not blank

Now I am going to spend some more time -try to figure it out right
thank you
Jun 14 '09 #3
buddyr
107 100+
Expand|Select|Wrap|Line Numbers
  1. if (maskedTextBox1.Text.Length < 14)
  2.             {  
  3.               errorProvider1.SetError(maskedTextBox1, "You must enter a valid telephone number");
  4.             }
  5.  
this works so for now I am going to use it -thanks for help-
Jun 14 '09 #4

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

Similar topics

7
by: |{evin | last post by:
I'm currently working on what has turned in to something much larger that I wanted it to be. The upside is that I'm getting $$ to do it... but anywho. I currently have textboxes set up to...
1
by: Kostis | last post by:
Hello there! I have created a windows application in VB.NET and I want to retrieve data from an access database. I create the OleDbConnection, an OleDbAdapter, a dataset and finally a Data Form...
7
by: DazedAndConfused | last post by:
Curently I manualy code keypress edits. i.e. allow only 3 digits before decimal and two digits after decimal in .NET. Is there an easy solution to mask text boxes? The MSMASK32.OCX from vb6...
3
by: dmbuso | last post by:
I have a money field defined in a SQL Server 05 database with a value of 49.50. Also, it displays in SQL Server as 49.5000. I have a form in VB.NET 2005 and I'm using the new MaskedTextBox control...
2
by: Subhash | last post by:
Hi, I want to apply skin themes for a masted textbox. Please help me in this issue,
2
by: james.czebiniak | last post by:
newbie to .net I have a masked textbox intended to display/input salary. The mask is 999,999 or ###,###. When I place the info from the database into the field it formats incorrectly. The salary...
2
by: gayano | last post by:
Hi, I'm using Visual studio 2005 pro Ver..]]] I have a Form named form1 textbox named txtName masked textbox (Date Masked) named txtMaskedDate and a button to add data named btnAdd dim...
3
by: gayano | last post by:
Hi, I'm using Visual studio 2005 pro Ver..]]] I have a Form named form1 textbox named txtName masked textbox (Date Masked) named txtMaskedDate and a button to add data named btnAdd dim...
0
by: michels287 | last post by:
I have a masked textbox on my form. I have an onscreen keyboard with numbers only. The masked format for the masked textbox is: (###) ### - #### I want to make sure they enter the phone...
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.