初学者的问题!!--DropDownList控件问题 如何把选中的项目显示在文本框中,不用按钮,选中就直接显示在文本框中.请大家帮帮忙! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 autopostback=true;onselectindexchange事件中加:textbox.text=dropdownlist.stlectvalue.tostring(); DropDownList1的AutoPostBack设为Trueprivate void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e){ this.TextBox1.Text = this.DropDownList1.SelectedValue;} 就提交你的文本框.Text就完了呗 DropDownList1的AutoPostBack设为Trueprivate void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e){ this.TextBox1.Text = this.DropDownList1.SelectedValue;}我这样做了,可是我调试的时候他根本就不运行到this.TextBox1.Text = this.DropDownList1.SelectedValue.是不是和数据库里的数据有关啊,我是把数据库里符合条件的记录放在下拉列表里! 「玩一玩」翻译:基于AForge.Net的扑克牌视频识别程序 急~~!!关于C#操作Excel的问题!在线等 dropdownlist 三级联动问题! web和windowsform DataGridViewComboBoxColumn 的问题 有点难度的TreeView问题,高手请进!!! 数据库插入的与显示的问题 哪位高手指点指占!!! C# WPF 如何通过B窗体动态向A窗体增加控件 关于变量与控件的问题 如何发送CTRL+C终止由Process启动的DOS命令? 求森林深度搜索例子,急 高手指点:可以在自己写的windows服务里面加上方法或是属性吗
onselectindexchange事件中加:
textbox.text=dropdownlist.stlectvalue.tostring();
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.TextBox1.Text = this.DropDownList1.SelectedValue;
}
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.TextBox1.Text = this.DropDownList1.SelectedValue;
}
我这样做了,可是我调试的时候他根本就不运行到this.TextBox1.Text = this.DropDownList1.SelectedValue.
是不是和数据库里的数据有关啊,我是把数据库里符合条件的记录放在下拉列表里!