gpt4 book ai didi

mysql - 组合框将依赖于另一个组合框的值

转载 作者:行者123 更新时间:2023-11-29 21:49:31 26 4
gpt4 key购买 nike

我有 2 个组合框。组合框 1 的值为 NHM、科学与技术、SAM,组合框 2 为空,直到您在组合框 1 上选择一个值。如果我选择 NHM 组合框 2 应具有 HRM、旅游值,如果我选择 SAM,则组合框 2 的值应显示会计、管理。我一整天都在尝试这样做,但我无法找出正确的语法。我在组合框 1 上使用未绑定(bind)模式。不幸的是我只能将我的组合框1保存在我的数据库中。因此我不知道要使用什么语法,因为我对使用 VB 很陌生。

最佳答案

您能否针对每种情况执行如下操作?不束缚就好了。

Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As   System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedItem.ToString = "NHM" Then
ComboBox2.Items.Add("HRM")
ComboBox2.Items.Add("Tourism")
ComboBox2.Refresh()

End If
End Sub

关于mysql - 组合框将依赖于另一个组合框的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33787069/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com