从Combobox中选择值时,如何自动获取数据到文本框 [英] How Can I Fetch Data Automatically To The Textbox When Selecting A Value From Combobox

查看:208
本文介绍了从Combobox中选择值时,如何自动获取数据到文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个组合框和一个文本框...如何从组合框中选择一个值时自动将数据提取到文本框,Iam遵循multi = tier架构

i have one combobox and a text box ...how can i fetch data automatically to the textbox when selecting a value from combobox ,Iam following multi=tier architecture

推荐答案

解决方案:

组合框中有事件'
Solution:
there is event in combobox '
private void ComboBox1_SelectedIndexChanged(object sender,
        System.EventArgs e)



'



用你的代码将数据提取到这个偶数中。



详细说明: Combobox偶数


private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            textBox1.Text = comboBox1.SelectedItem.ToString();
        }


这篇关于从Combobox中选择值时,如何自动获取数据到文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆