gpt4 book ai didi

vb.net - 根据另一个组合框选定值设置组合框值 - VB.NET

转载 作者:行者123 更新时间:2023-12-01 19:06:23 25 4
gpt4 key购买 nike

我有两个组合框。如果用户从第一个组合框中选择某个值,那么我希望第二个组合框自动更改并选择其相应的值。

例如:

If Me.InstitutionAdvisoryFirmsComboBox1.SelectedValue = 3 Then 
Me.WeightComboBox1.SelectedValue = 2

我也尝试过:

If Me.InstitutionAdvisoryFirmsComboBox1.SelectedText = "Internal Guidelines" Then                 
Me.WeightComboBox1.SelectedText = "None"

有人可以帮忙吗?

最佳答案

//selected index changed event for the combo box 

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles InstitutionAdvisoryFirmsComboBox1.SelectedIndexChanged

If Me.InstitutionAdvisoryFirmsComboBox1.SelectedIndex = 3 Then
If Me.WeightComboBox1.Items.Count >= 2 Then // make sure you are not accessing an index out of range
Me.WeightComboBox1.SelectedIndex = 2
End If
End If

End Sub

关于vb.net - 根据另一个组合框选定值设置组合框值 - VB.NET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25184896/

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