c# winform
how to fill Textbox on the basis of combobox value selection,,, Eg: If I select value A from combobox then B is automatically assign to 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.
Satyapriya NayakPosted Jun 7, 2014, 4:29 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 Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
comboBox1.Items.Add("---Select---");
comboBox1.Items.Add("A");
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.Text == "A")
{
textBox1.Text = "B";
}
else
{
textBox1.Text = "";
}
}
}
}
VulpesPosted Jun 6, 2014, 7:48 PM