How to give validation in window applications based on ComboBox .can u explain plz.
How to validation for combox in windows applications
Hi Guys,
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.
Satyapriya NayakPosted Sep 27, 2012, 12:02 AM
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
foreach (Control cnt in this.Controls)
{
if (cnt is ComboBox)
{
ComboBox cmb = (ComboBox)cnt;
if (cmb.SelectedItem == null)
{
errorProvider1.SetError(cmb, "Combox is not Selected");
cnt.BackColor = Color.Plum;
}
}
}
}
private void Form3_Load(object sender, EventArgs e)
{
comboBox1.Items.Add("a");
}
}
}
Appala Raju VurukootiPosted Sep 26, 2012, 11:51 PM
But i need based on the ErrorProvider Control in windows applications.
Satyapriya NayakPosted Sep 26, 2012, 7:01 AM