本文介绍了如何在vb.net中单击组合框项时更新文本框项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
单击组合框项后,我在更改文本框中的项目时遇到问题。我在表格设备中添加了像设备ID,设备项目(组合框),模型(组合框),数量,序列号和状态等项目。我希望在编辑equipmentItem(组合框)后,项目状态(文本框)自动从可用变为不可用。任何人都可以帮助我??
I have a problem to change already item in textbox after click combo box item. I add item like equipmentID,equipmentItem(combobox),model(combobox),quantity, serialnumber and status in form Equipment. I want item status(textbox) change automatic from available to unvailable after edit the equipmentItem(combobox). Anybody can help me??
推荐答案
<asp:DropDownList ID="SomeComboBox" runat="server" AutoPostBack="True"></asp:DropDownList>
那么您将需要代码来更改VB代码中SelectedIndexChanged事件中的文本框。这样的事情:
Then you will need code to change the textbox in the SelectedIndexChanged event in the VB code. Something like this:
Private Sub SomeComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles SomeComboBox.SelectedIndexChanged
'Code to change textbox here
If SomeTextBox.Text = "available" Then SomeTextBox.Text = "unavailable"
End Sub
这篇关于如何在vb.net中单击组合框项时更新文本框项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!