in this TextBox value is '0' then it show the error give
a validation control on TextBox....
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
sriPosted Oct 17, 2012, 1:33 AM
Thanks.
sriPosted Oct 17, 2012, 1:18 AM
errorProvider1 is does not exist....
sriPosted Oct 17, 2012, 1:05 AM
errorProvider1.SetError(textBox1, "You have entered 0");
Satyapriya NayakPosted Oct 16, 2012, 9:41 AM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (Convert.ToBoolean(textBox1.Text == "0"))
{
errorProvider1.SetError(textBox1, "You have entered 0");
}
else
{
errorProvider1.Clear();
}
}
}
}
Thanks
Dorababu MekaPosted Oct 16, 2012, 7:03 AM
check here for error provider
http://www.dotnetperls.com/errorprovider