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

validation checks in desktop application

in windows application i want to apply validation checks.i hv tried one for empty textbox
i.e.
if (textBox1.Text == "")
{
MessageBox.Show("Enter phone number", "Error in Input", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.textBox1.Clear();
this.textBox1.Focus();
return;
}
Jul 21 '07 #1
3 2179
Atran
319 100+
in windows application i want to apply validation checks.i hv tried one for empty textbox
i.e.
if (textBox1.Text == "")
{
MessageBox.Show("Enter phone number", "Error in Input", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.textBox1.Clear();
this.textBox1.Focus();
return;
}
Hello:
I dont understand what do you want?
But maybe I can help you, check this link:
Check if a textbox contains a number..

Hope I helped you.
Jul 21 '07 #2
Hello:
I dont understand what do you want?
But maybe I can help you, check this link:
Check if a textbox contains a number..

Hope I helped you.
:)
actually i missed lkast sentence that was

how to validate numbers and alphabetic characters??

any how..thx alot one of the prb is solved,,numbers are validated now wud u plz do one more favour?
tell me how to validate text
(alphabetic characters)
Jul 21 '07 #3
Expand|Select|Wrap|Line Numbers
  1. private void txtPort_Validating(object sender, CancelEventArgs e){
  2.             try
  3.             {
  4.                 int x = int.Parse(txtPort.Text);
  5.                 errorProvider1.SetError(txtPort, "");
  6.             }
  7.             catch (Exception ex)
  8.             {
  9.                 errorProvider1.SetError(txtPort, ex.Message);
  10.             }
  11.         }
In .NET we have ErrorProvider control tr
txtPort_Validating write this function in your textbox1 validation event.



[quote=software student]
Hello:
I dont understand what do you want?
But maybe I can help you, check this link:
Check if a textbox contains a number..

Hope I helped you.[/QU
:)
actually i missed lkast sentence that was

how to validate numbers and alphabetic characters??

any how..thx alot one of the prb is solved,,numbers are validated now wud u plz do one more favour?
tell me how to validate text
(alphabetic characters)
Jul 21 '07 #4

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

Similar topics

4
by: TG | last post by:
I have a validation form that must behave differently based on the results of a PHP validation check. I have a post command at the top of my form that calls itself. I don't leave the form when...
21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
2
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For...
2
by: Doslil | last post by:
I am trying to validate the fields in my database.I have already validated the fields to check for not null.Here is what I have written for Numeric and text field. Private Function EENUM() On...
7
by: Tom | last post by:
I know how to use these great controls. They work very well. But is there a method or property I can use to set the focus to the field that is in error. For example... If I have a page with 5...
1
by: Nick | last post by:
I was wondering other opinions on this topic... I am working on an n-tier application which may be broken out to different servers at a later date. How should I go about the validation? I would...
5
by: Advo | last post by:
Basically, im redesigning a form page on our website. Currently the user submits the form, it does a few javascript checks and either submits to the "processstuff.php" page, or gives the user a...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
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: 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:
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...
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.