Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

2 comboboxes 1 based on first selection making other 2 Visible

$
0
0
Well I have 1 cbo that I populate through a string with 3 selections that are added on form load

Private Sub cboMP_SelectedIndexChanged(sender As Object, e As EventArgs)
If comboBox1.SelectedItem.ToString() = "M&P" Then
cbomainper.Visible = True
Else
cbomainper.Visible = False
End If
End Sub


I cant get this to work so I tried AfterUpdate

Private Sub cboMP_AfterUpdate()
If cboMP.Text = "M&P" Then
cbomainper.Visible = True
Else
cboproper.Visible = True
End If
End Sub


Neither of these codes are working. Any suggestions or help would be greatly appreciated.

Also another note, while I'm making the cbos invisible till selected I cant seem to get the labels to go invisible either.

lblmainper.visible = false

Cheers

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>