473,749 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

masked textbox control with error provider control

107 New Member
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 5477
tlhintoq
3,525 Recognized Expert Specialist
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 New Member
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 New Member
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
1938
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 capture phone numbers, I've also got regular expression validation in place to force the format of the number to be (xxx) xxx-xxxx. The problem is, the people that are paying me don't want this. What they'd like to see is a magic textbox that fills in...
1
3478
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 using the Data Form Wizard. Everything works fine. The problem is that I want to use the masked edit control to manage the way some fields appear, and are being stored to the database. I insert the "Microsoft Masked Edit Control, version 6.0" (Path...
7
8698
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 does not seem to be appropriate for a desktop application with textboxes not bound to a dataset, am I wrong? -- How time fly's when you don't know what you are doing!
3
9137
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 in Visual Studio. I set the Mask property for the text box to "$999.00". The problem is when I run the form the text box displays "$495.00" and not "$49.50" as one would expect. It it shifting the values left here. How do I fix this? Thanks...
2
1876
by: Subhash | last post by:
Hi, I want to apply skin themes for a masted textbox. Please help me in this issue,
2
11354
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 is 75000. In the textbox it displays 750,00 What am I doing wrong?? ------------------------------------------------------------------------------------ Posted from WWWCoder.com (http://www.wwwcoder.com - The Web Developer's Resource site.
2
2109
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 name as string
3
3757
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 name as string
0
1754
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 numbers properly, hence the mask. What I cannot seem to figure out is why can I not send the button captions (captions are the value of the number buttons, 1 through 9) into the masked box without an error? I get: Run Time Error '380'. Invalid...
0
9566
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9388
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8256
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6800
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.